Hello,
I can't figure out why this regex fails editing an XML header:
Thank you.
I can't figure out why this regex fails editing an XML header:
with open(INPUTFILE) as reader: content = reader.read() #I need to just get <gpx> #OK content = re.sub('<gpx', '<BLAH', content) #BAD content = re.sub('<gpx.+?>', '<gpx>', content,re.MULTILINE) #BAD content = re.sub('<gpx.+?>', '<gpx>', content,re.MULTILINE|re.DOTALL) #BAD content = re.sub('<gpx.+?>', '<gpx>', content,re.MULTILINE|re.DOTALL|re.IGNORECASE)Any idea what I could try?
Thank you.