1 2 3 4
import re pm = re.compile(r'.*\b(dog)$') has = pm.match("i love dog") print(has)
1
<_sre.SRE_Match object at 0x4034abe0>