PyDocs

Nav

Text Processing Services

prefixmatch

re

function · Added in 3.15 (source)
  • prefixmatch(pattern, string, flags=0)
Try to apply the pattern at the start of the string, returning
a Match object, or None if no match was found.
1 Example
>>> re.prefixmatch("c", "abcdef")  # No match
>>> re.search("^c", "abcdef")      # No match
>>> re.search("^a", "abcdef")      # Match
<re.Match object; span=(0, 1), match='a'>
from the Python docs
See Also
No see-alsos for re/prefixmatch
0 Notes
No notes for prefixmatch