In case another newbie stumbles on the same issue…
Gpxpy probably offers useful features anyway, but the reason the regex above didn't work, is simply that two switches are needed: "re.MULTILINE|re.DOTALL".
Gpxpy probably offers useful features anyway, but the reason the regex above didn't work, is simply that two switches are needed: "re.MULTILINE|re.DOTALL".
p = re.compile('<trk>.+?</trk>',re.MULTILINE|re.DOTALL) m = p.findall(inputfile) for item in m: print(item)