regex to extract substring from string python code example
Example 1: regex in python to obtain only the string in python
import re
print(" ".join(re.findall("[a-zA-Z]","your string")))
Example 2: extract text regex python
>>> import re
>>> re.findall(r'\d{1,5}','gfgfdAAA1234ZZZuijjk')
>>> ['1234']