I have an svg with lines like this:
I want to remove the M's where the numbers after the M match the numbers after the L in front of it. I have this regex which seems to be working: https://regex101.com/r/UG2VHo/6
However when I try to remove all these instances using python's regex module, the printed string still includes those matching Ms.
import regex
with open('test-mjlr.svg','r') as svg:
data = svg.read()
r = regex.sub('L([0-9]+,[0-9]+) \KM\1','',data,flags = regex.M)
print r
How can I do this?