[issue32319] re fullmatch error with non greedy modifier

Serhiy Storchaka report at bugs.python.org
Thu Dec 14 03:10:33 EST 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

No, this is not how fullmatch() works. Otherwise there wouldn't be need to add it into the stdlib. You could just check end() of the result.

fullmatch() acts like match() with added \Z. But if the pattern contains multiple alternates you need to add \Z at the end of every branch (r"foo\Z|bar\Z") or wrap the entire patch in a non-capturing group (r"(?:foo|bar)\Z").

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32319>
_______________________________________


More information about the Python-bugs-list mailing list