I want to replace string like
'''1 2 3 4 5 6 abcde fghij klmno pqrst 7 8 9 10 uvwxyz abcdef 11 12 13'''
to
'''1 2 3 4 5 6
abcde fghij klmno pqrst
7 8 9 10
uvwxyz abcdef
11 12 13'''
that is my method:
s = re.sub(r'(\d) ([a-z])', r'\1\n\2', s)
s = re.sub(r'([a-z]) (\d)', r'\1\n\2', s)
how can I do this in one regular expression? and I know I can do it use re.findall and groups but I want to find a more easy way?