Answers for "how to learn regex pyton"

2

regex in python

# pip install regex
import re
# simple find all
sample = "Nothing lasts... but nothing is lost"
found = re.findall("thing", sample)
print(found)
Posted by: Guest on October-02-2020
0

how to learn regex pyton

re.search(r'cake$', "Cake! Let's eat cake").group()

## The next search will return the NONE value, try it:
re.search(r'cake$', "Let's get some cake on our way home!").group()
Posted by: Guest on August-08-2021
-1

regex in python

>>> import re
>>> p = re.compile('ab*')
>>> p
re.compile('ab*')
Posted by: Guest on December-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language