Scan through string looking for a match, and return a corresponding match object instance. Return None if no position in the string matches.
>>> pattern = re.compile("d") >>> pattern.search("dog") # Match at index 0 <re.Match object; span=(0, 1), match='d'> >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
re/Pattern.search
Pattern.search