given a file that looks like this:
mmm 55 v1235
mmm 111 v1241
mmm 22 v2453
mmm 1 v3464
mmm 555 v5353
I want the result to be ( replace all digits with white spaces):
mmm v1235
mmm v1241
mmm v2453
mmm v3464
mmm v5353
Well I can find the length subtract and and turn to white space. can I do it in one line ?
something like that, but in sub second parameter is a string and not a regex:
new_line = re.sub(r'mmm \d+', r'mmm \s+', line)
line = re.sub(r'\d', ' ', line);line = re.sub(r'\d(?=\d* )', ' ', line);