Chris, now I understand the mystery of double backslash. That is because you
don't use *r *before your regex strings as shown in fixes.py. In that time I
did not notice the lack of that "r".
See http://docs.python.org/py3k/howto/regex.html#the-backslash-plague

2009/11/26 Chris Watkins <[email protected]>

>
>
> On Thu, Nov 26, 2009 at 20:39, Bináris <[email protected]> wrote:
>
>>
>>
>> 2009/11/26 Chris Watkins <[email protected]>
>>
>>
>>> Notice that the -regex parameter is used, and the search text ends with
>>> (.*$), which matches the entire rest of the article.
>>>
>> Not bad, not bad. :-) Nice solution.
>> \\2 is strange for me, because it should be \2, and it does work that way.
>> I thought, \\2 should be interpreted as a \ mark followed by a 2 number, not
>> \2 (second group). So I don't understand again. :-)
>>
>
> I guess it's \2, but because of the regex tag, we need to escape the
> backslash? I don't know - it works, and I'm happy :-). Good question though,
> I'll keep that in mind if I ever use \\1 without the regex - probably needs
> to change to \1.
>
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to