Try to apply the pattern at the start of the string, returning a Match object, or None if no match was found.
>>> 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'>
re/prefixmatch
prefixmatch