fork download
  1. import re
  2. rx = r'\d+[.)]\B\s*'
  3. test_str = "1) there is a dsfsdfsd and 2) there is another one and 3) yet another case\n\"we will give 4. there needs to be another option and 6.99 USD is a bit amount"
  4. print([x for x in re.split(rx,test_str) if x])
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['there is a dsfsdfsd and ', 'there is another one and ', 'yet another case\n"we will give ', 'there needs to be another option and 6.99 USD is a bit amount']