fork download
  1. # your code goes here
  2. import re
  3. rx = re.compile(r'\b\d+\.\d+.+?(?=\d+\.\d+|$)')
  4. string = "1.1 This is the 2,1 first 1.2 This is the 2,2 second 1.3 This is the 2,3 third "
  5. matches = rx.findall(string)
  6. print(matches)
Success #stdin #stdout 0s 9992KB
stdin
Standard input is empty
stdout
['1.1 This is the 2,1 first ', '1.2 This is the 2,2 second ', '1.3 This is the 2,3 third ']