Page 1 of 1

Regular Expression to Match Output

Posted: Mon Jul 11, 2005 2:57 pm
by bradleysmith
I've added the comeau compiler to my list of tool. It's error output looks like this:

"C:\scratch7\ART05-6533735\C1.h", line 13: error: identifier "privTypedef" is
undefined
const privTypedef p1

and I need the regexp so that Textpad can open the erroneous file at the right line number.

The following regexp manages to find the bits I'm after if I do a normal search in the output window but double clicking on the error line just gives me a message telling me textpad can't open the file?

\"[^"]+\", line [0-9]+:

I also tried putting parenthesis in e.g.

\"([^"]+)\", line ([0-9]+):

Posted: Mon Jul 11, 2005 5:08 pm
by ben_josephs
You need the parentheses to catch the bits required to make the link.

For

Code: Select all

"([^"]+)", line ([0-9]+):
(with unescaped parentheses) to work, you must use Posix syntax:
Configuration | Preferences | Editor

[X] Use POSIX regular expression syntax
as all right-thinking people do.

With this regex, the File register is 1 and the Line register is 2.