fork download
  1. import re
  2. line = ' 2501 12345678910 12345678910 40m Test Content\t Here. SMxx x x x x x x x'
  3. rx = re.compile(r'^((?:[^\t\n]*\t){3})(.*?)(?=\t\s*SM)')
  4. print(rx.sub(lambda x: f"{x.group(1)}{x.group(2).replace(chr(9), '<TAB WAS HERE>')}", line))
Success #stdin #stdout 0.03s 9668KB
stdin
Standard input is empty
stdout
    2501	12345678910	12345678910	40m Test Content<TAB WAS HERE> Here.	SMxx  x x x x x x x