Run »
import re #The search() function returns a Match object: txt = "The rain in Spain" x = re.search("ai", txt) print(x)
<_sre.SRE_Match object; span=(5, 7), match='ai'>