re.match(pattern, string, flags=0)
import re re.match(r'hello', 'hello world')
<re.Match object; span=(0, 5), match='hello'>