View Single Post
Old 05-19-2013, 11:16 AM   #12
hegi
Enthusiast
hegi began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Dec 2012
Device: Kindle 4 & Kindle PW 3G
preprocess_regexps -- use of variables in the replace string

... me again!

finally got it working. Here the Regex code, that does the trick:

Code:
preprocess_regexps = [(re.compile(r'(<span class="hcf-location-mark">[^<]*)(</span>)', re.DOTALL|re.IGNORECASE), lambda match: match.group(1) + '. ' + match.group(2))]
... just to have this documented here.

Hegi.
hegi is offline   Reply With Quote