Skip to content

grep: Make filename matching regex include all possible characters

Currently when doing a search that includes files that contain @, like po/ca@valencia.po, the filename extracted from the grep output with the regex is incomplete as it instead thinks the filename is valencia.po. So when accessing the line location, it opens an empty file because obviously valencia.po doesn't exist, whereas po/ca@valencia.po does exist.

Anyway, the regex that extracts the file name, line number and line content is too restrictive in what in detects as being valid for a filename. It only accepts alphanumerical characters and characters contained in [-_+.]. As such, there's not much reason to restrict so much the set of allowed characters for a filename, so it's better to allow all of them except the colon (as that's the field separator between filename and line number).

Fixes #1587 (closed)

Merge request reports