Good evening or something,
In fixes.py I would like to change something this way: repeat the first group with a trailing 0 (zero) character. Something like (ur'(x|y|z)', ur'\10') This results in "the tenth group", and execution stops with "no such group" message. How can I explain to the bot that I want to copy \1 and a zero character immediately after it?
Thank you,
On Tue, Oct 27, 2009 at 2:36 PM, Bináris wikiposta@gmail.com wrote:
(ur'(x|y|z)', ur'\10') This results in "the tenth group", and execution stops with "no such group" message. How can I explain to the bot that I want to copy \1 and a zero character immediately after it?
ur'\g<1>0'; see also < http://docs.python.org/library/re.html >.
Thank you for the answers, Francesco's version works, and Pathoschild's version is for some reason not very happy with the idea of working. :-) That's what I tried previously. Now I have a quite pretty package of Hungarian spellcheck fixes. I am sorry I can't share it with you. :-)
One more question: how can I substitute a new line? \n works in the query, but not in the expression to be substituted.
pywikipedia-l@lists.wikimedia.org