[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-10-11 Thread Berker Peksag
Change by Berker Peksag : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Serhiy that the docs correctly and completely describe the behavior. -- nosy: +rhettinger status: pending -> open ___ Python tracker

[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >From the documentation: """ As the target string is scanned, REs separated by ``'|'`` are tried from left to right. When one pattern completely matches, that branch is accepted. This means that once ``A`` matches, ``B`` will not be tested further, even if

[issue23532] add example of 'first match wins' to regex "|" documentation?

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions type: behavior -> enhancement versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue23532] add example of 'first match wins' to regex | documentation?

2015-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: Not quite all. POSIX regexes will always look for the longest match, so the order of the alternatives doesn't matter, i.e. x|xy would give the same result as xy|x. -- ___ Python tracker rep...@bugs.python.org

[issue23532] add example of 'first match wins' to regex | documentation?

2015-02-26 Thread R. David Murray
R. David Murray added the comment: The thing is, what you describe is fundamental to how regular expressions work. I'm not sure it makes sense to add a specific mention of it to the '|' docs, since it applies to all regexes. -- assignee: - docs@python components: +Documentation