Regular Expression to Match Output

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
bradleysmith
Posts: 4
Joined: Wed Jun 09, 2004 9:08 am

Regular Expression to Match Output

Post 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]+):
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
Post Reply