re.match "matches" from the beginning of the line, but there is an extra 1 .
Instead, use re.search , which will "search" anywhere on the string. And, in your case, also find something:
>>> re.search(pattern,s).groups() ('89059809102', '30589533')
If you remove the brackets in the template, it will still return a valid _sre.SRE_Match object, but with empty groups :
>>> re.search('\s\d{11}/\d{8}',s).groups() ()
eumiro
source share