fork download
  1. import re
  2. mystring = "\n this \n 1. is \n 2. some \n 3. text \n"
  3. k = re.sub(r"\n (\d)", r"\1", mystring)
  4. print(k)
Success #stdin #stdout 0.02s 9700KB
stdin
Standard input is empty
stdout
 this 1. is 2. some 3. text