@Bináris: "(?m)" means /^/ and /$/ will also match beginning and ending of lines, while "(?s)" means /./ will also match "\n". These two flags are not the same and can't use interchangeably.

@Michael Hamm: Beside Bináris's suggestion, re.escape should be used only on pattern parameter, not replacing text; use match.group(1) instead of re.escape(match.group(1))

On Thu, May 2, 2013 at 2:41 PM, Bináris <wikiposta@gmail.com> wrote:
Try this first in replacements:

ur'(?m)^== *([a-zA-Z ]+) *==\n+ etc.
m for multiline (sometimes ?s works instead, I just use it without understanding why), and space* in case there are spaces between == marks.

--
Bináris

_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l




--
Sorawee Porncharoenwase