I am trying to extract all occurrences of a substring within a string using Python Regex. This is what I have tried:
import re
line = "The dimensions of the first rectangle: 10'x20', second rectangle: 10x35cm, third rectangle: 30x35cm"
m = re.findall(r'd+x.*?[a-zA-Z]', line)
print (m)
The output I am getting is ['10x35c', '30x35c']
The output I am trying to achieve is ['10'x20'', '10x35cm', '30x35cm']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…