how to search using regex in python code example
Example 1: searching for a pattern in text with re python
import re
xx = "guru99,education is fun"
r1 = re.findall(r"^\w+",xx)
print(r1)
Example 2: python re
if pattern := re.search("[iI] am (.*)", "I am tired"):
print(f"Hi {pattern.group(1)}, I'm dad!")