1 2 3 4 5 6 7
import re def string_literals(patterns,text): for pattern in patterns: if re.search(pattern, text): return ('Matched!') else: return ('Not Matched!')