import re
txt = """The rain in
Spain"""
x = re.search("^The.*spain$", txt, flags=re.S|re.I)
if x:
print("YES! We have a match!")
else:
print("No match")
0 Responses to search a pattern/regex string in another with newline and case insensitive
Something to say?