fork download
  1. import re
  2. s="C+11.,18.,25.6.,2.,23.7.,27.8.23"
  3. rx = r'\b(\d{1,2}(?:\.,\d+)*)\.(\d{1,2})\b'
  4. results = [(days.split('.,'),month,) for days, month in re.findall(rx, s)]
  5. print(results)
  6. # => [(['11', '18', '25'], '6'), (['2', '23'], '7'), (['27'], '8')]
Success #stdin #stdout 0.03s 9616KB
stdin
Standard input is empty
stdout
[(['11', '18', '25'], '6'), (['2', '23'], '7'), (['27'], '8')]