I have a quick question as my code below:
import re
s = '1-4-1'
p = '\d-\d'
re.findall(p,s)
>> ['1-4']
>> but what I expected is: ['1-4', '4-1']
I have no idea why the pattern cannot catch '4-1'
I have a quick question as my code below:
import re
s = '1-4-1'
p = '\d-\d'
re.findall(p,s)
>> ['1-4']
>> but what I expected is: ['1-4', '4-1']
I have no idea why the pattern cannot catch '4-1'