import re
xx = "guru99,education11 is fun"
r1 = re.findall(r"^w+",xx)
print(r1)
# import re module
import re
Substring ='string'
String1 ='''We are learning regex with geeksforgeeks
regex is very useful for string matching.
It is fast too.'''
String2 ='''string We are learning regex with geeksforgeeks
regex is very useful for string matching.
It is fast too.'''
# Use of re.search() Method
print(re.search(Substring, String1, re.IGNORECASE))
# Use of re.match() Method
print(re.match(Substring, String1, re.IGNORECASE))
# Use of re.search() Method
print(re.search(Substring, String2, re.IGNORECASE))
# Use of re.match() Method
print(re.match(Substring, String2, re.IGNORECASE))
>>> match.re
re.compile('(d{3}) (d{2})')
>>> match.string
'39801 356, 2102 1111'