Skip to content
Prev Previous commit
Next Next commit
Trim a bit more from 'prefixmatch() versus search()'
  • Loading branch information
hugovk committed Apr 4, 2026
commit 920a69581a0981035bc9de4a560483e9515a2fde
4 changes: 1 addition & 3 deletions Doc/howto/regex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,7 @@ misunderstood.

:func:`!prefixmatch` aka :func:`!match` only checks if the RE matches at the
beginning of the string while :func:`!search` scans forward through the
string for a match. :func:`!prefixmatch` only reports a successful match which
starts at zero; if the match wouldn't start at zero, :func:`!prefixmatch` will
*not* report it. ::
string for a match. ::

>>> print(re.prefixmatch('super', 'superstition').span())
(0, 5)
Expand Down
Loading