Bugs item #1816352, was opened at 2007-10-19 10:33
Message generated for change (Comment added) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=181635…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: replace.py regex '(?ms)^(.*)$'
Initial Comment:
In order to use replace.py to "append" text, the regex needs to match the entire
page using '(?ms)^(.*)$' '\1 text to add'. I thought that this was
working a while ago, and I documented it as an example on [[m:Replace.py]] on September
24.
This doesnt appear to be working now, with the code infinitely looping: it continually
matches the page and appends the replacement text.
The attached patch makes any regex that matches the entire page a special case.
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date:
2007-10-19 12:41
Message:
Logged In: YES
user_id=880694
Originator: NO
Thanks for your report. This bug didn't only occur when the full text is
matched. Take for example this regex, which seems to do the same as yours,
but is much simpler:
python replace.py -regex "$" "foobar" -page:asdf
I found a more elegant solution to this bug, it is now in SVN. Instead of
while True:
there is now a real loop termination condition:
while index < len(text):
This seems to solve this problem.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=181635…