re.search(pattern, string, flags=0)
import re re.search(r'\bworld\b', 'hello world')
<re.Match object; span=(6, 11), match='world'>