05-30-2018, 07:35 AM | #1 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
How to do back-matches with preprocess_regexp
Hi Kovid et al
I'm trying to use preprocess_regexps more powerfully to do some rewriting and can't seem to make the back-matching work properly. Code:
(re.compile(r'<li class="css.*?>(.*?)</li>', re.IGNORECASE), lambda match: '') |
05-30-2018, 07:51 AM | #2 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Nevermind. For future reference for others this works:
Code:
..., lambda m: m.group(1) |