17 lines
208 B
Python
17 lines
208 B
Python
|
# import re library
|
||
|
import re
|
||
|
|
||
|
# Here's our string
|
||
|
lol = "Lol this is a string"
|
||
|
print(lol)
|
||
|
|
||
|
# now let's filter out the word "string"
|
||
|
p = re.compile('string')
|
||
|
|
||
|
filtered = p.match('string')
|
||
|
|
||
|
print(filtered)
|
||
|
|
||
|
|
||
|
|