In this example we will show how to get the string passed into the function when using regular expressions in Python.
Source Code
import re
str1 = 'I love Python'
r = re.search('o', str1)
print(r.string)
Output:
I love Python
In this example we will show how to get the string passed into the function when using regular expressions in Python.
import re
str1 = 'I love Python'
r = re.search('o', str1)
print(r.string)
Output:
I love Python