ID EN
Regular Expression

match

Python 3.11

If zero or more characters at the beginning of string match the regular expression pattern, return a corresponding Match. Return None if the string does not match the pattern; note that this is different from a zero-length match.

Syntax

PYTHON
re.match(pattern, string, flags=0)

See Also

Match MULTILINE re.match() search() search() vs. match()