Matches zero or more characters at the beginning of the string.
>>> pattern = re.compile("o") >>> pattern.prefixmatch("dog") # No match as "o" is not at the start of "dog". >>> pattern.prefixmatch("dog", 1) # Match as "o" is the 2nd character of "dog". <re.Match object; span=(1, 2), match='o'>
re/Pattern.prefixmatch
Pattern.prefixmatch