import re
mystring = "\n this \n 1. is \n 2. some \n 3. text \n"
k = re.sub(r"\n (\d)", r"\1", mystring)
print(k)