Comment 1 for bug 569034

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

I also suffered from this issue, breaking the gedit latex plugin in this regard.

I further adapted the regex, since I had two issues with the proposed solution:

1) I found random [number] snippets in the file name, probably coming from latex' page count output. Thus I forbid [] in the regex.
2) For me, the gedit plugin had in fact issues with the trailing space, so I require at least one alphanumeric character as the last one.

I’m no regex expert, so there might be more elegant ways, but this currently works for me™:

re_file = re.compile("(\\((?P<file>[^\n\t(){}\[\]]*\w)|\\))")