demo_regex_meta4.py:
import re str = "hello world" #Check if the string starts with 'hello': x = re.findall("^hello", str) if (x): print("Yes, the string starts with 'hello'") else: print("No match")
➜ begtut>python demo_regex_meta4.py
Yes, the string starts with 'hello'