[issue27586] Is this a regular expression library bug?

2016-07-22 Thread Bruce Eckel
Bruce Eckel added the comment: Thank you ebarry, very helpful. Tim, sorry I missed you at Pycon. -- ___ Python tracker ___

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Emanuel Barry
Emanuel Barry added the comment: For future reference, if your input can have arbitrary escapes, it might be a good idea to pass it through re.escape; it does proper escaping so that stuff like e.g. \g in your input will get treated as a literal backslash, followed by a literal 'g', and not

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
Bruce Eckel added the comment: Urk. There was exactly a \g in the input. Sorry for the bother. -- resolution: -> not a bug ___ Python tracker ___

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Tim Peters
Changes by Tim Peters : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Tim Peters
Tim Peters added the comment: Well, some backslash escapes are processed in the "replacement" argument to `.sub()`. If your replacement text contains a substring of the form \g not immediately followed by < that will raise the exception you're seeing. The parser is expecting to

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
Bruce Eckel added the comment: Sorry, I thought maybe the error message would be indicative of something. Here's the re: find_output = re.compile(r"/\* (Output:.*)\*/", re.DOTALL) Here's the program: #! py -3 # Requires Python 3.5 # Updates generated output into extracted Java programs in

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Tim Peters
Tim Peters added the comment: If you don't show us the regular expression, it's going to be darned hard to guess what it is ;-) -- nosy: +tim.peters ___ Python tracker

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
New submission from Bruce Eckel: This looks suspicious to me, like it could be a library bug, but before chasing it down I was hoping someone might be able to tell me whether I might be on to something: Traceback (most recent call last): File "update_extracted_example_output.py", line 22,