Blame view

NKJP/preProcessing/fixHeader.py 268 Bytes
Jan Lupa authored
1
2
3
4
5
6
7
8
9
10
import re
import sys
from typing import Match

def fix(m: Match) -> str:
	return m.group(1) + re.sub(r'>', r'>', m.group(2)) + m.group(3)

if __name__ == '__main__':
	with open(sys.argv[1]) as i:
		for l in i: print(re.sub(r'(<.+?>)(.+?)(</.+?>)', fix, l), end='')