0

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']

Demo

I have no idea why the pattern cannot catch '4-1'

Roy
  • 159
  • 3
  • 12

0 Answers0