Python Function Reference

re.match
If zero or more characters at the beginning of string match the regular expression pattern.
Python 3.13
re.match(pattern, string, flags=0)
pattern
The regular expression to match.
string
The string to match.
flags
Flags that modify the expression`s behavior.
Examples
Python 3.13
>>> import re
>>> re.match(r'hello', 'hello world')
<re.Match object; span=(0, 5), match='hello'>