[issue42353] Proposal: re.prefixmatch method (alias for re.match)

Serhiy Storchaka report at bugs.python.org
Sat Nov 14 07:02:36 EST 2020


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

I seen a code which uses re.search() with anchor ^ instead of re.match(), but I never seen a code which uses re.match() instead of re.search(). It just won't work unless you add explicit ".*" or ".*?" at the start of the pattern, and it is a clear indication that re.match() matches the start of the string.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list