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")