[issue27800] Regular expressions with multiple repeat codes

2016-10-14 Thread Martin Panter
Martin Panter added the comment: I committed my patch as it was. I understand Silent Ghost’s objection was mainly that they thought the new paragraph or its positioning wouldn’t be very useful, but hopefully it is better than nothing. Perhaps in the future, the documentation could be restructu

[issue27800] Regular expressions with multiple repeat codes

2016-10-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5f7d7e079e39 by Martin Panter in branch '3.5': Issue #27800: Document limitation and workaround for multiple RE repetitions https://hg.python.org/cpython/rev/5f7d7e079e39 New changeset 1f2ca7e4b64e by Martin Panter in branch '3.6': Issue #27800: Mer

[issue27800] Regular expressions with multiple repeat codes

2016-10-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> martin.panter stage: patch review -> commit review versions: +Python 3.7 ___ Python tracker ___ ___

[issue27800] Regular expressions with multiple repeat codes

2016-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Thanks Martin. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailin

[issue27800] Regular expressions with multiple repeat codes

2016-09-03 Thread Martin Panter
Martin Panter added the comment: Here is a patch for the documentation. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file44356/multiple-repeat.patch ___ Python tracker

[issue27800] Regular expressions with multiple repeat codes

2016-08-19 Thread Martin Panter
Martin Panter added the comment: Okay so it sounds like my usage is valid if I add the brackets. I will try to come up with a documentation patch as some stage. The reason why it is not supported without brackets is to maintain a bit of consistency with the question mark (?), which modifies th

[issue27800] Regular expressions with multiple repeat codes

2016-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: This appears to be a doc issue to clarify that * cannot directly follow a repetition code. I believe there have been other (non)bug reports like this before. -- nosy: +terry.reedy ___ Python tracker

[issue27800] Regular expressions with multiple repeat codes

2016-08-19 Thread Matthew Barnett
Matthew Barnett added the comment: "*" and the other quantifiers ("+", "?" and "{...}") operate on the preceding _item_, not the entire preceding expression. For example, "ab*" means "a" followed by zero or more repeats of "b". You're not allowed to use multiple quantifiers together. The prope

[issue27800] Regular expressions with multiple repeat codes

2016-08-19 Thread R. David Murray
R. David Murray added the comment: It seems perfectly logical and consistent to me. {4} is a repeat count, as is *. You get the same error if you do 'a?*', and the same bypass if you do '(a?)*' (though I haven't tested if that does anything useful :). You don't need the ?:, as far as I can

[issue27800] Regular expressions with multiple repeat codes

2016-08-19 Thread Martin Panter
New submission from Martin Panter: In the documentation for the “re” module, it says repetition codes like {4} and “*” operate on the preceding regular expression. But even though “a{4}” is a valid expression, the obvious way to apply a “*” repetition to it fails: >>> re.compile("a{4}*") Trace