Regular expression to match error ouput

Using the Java SDK with TextPad

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

Post Reply
Linda

Regular expression to match error ouput

Post by Linda »

Hello,

When I try to compile and double-click on the errors in the "Command Results", it says, "Cannot jump to item under cursor". It does work if just using the stock "Compile Java" menu item from the Tools menu, but compiling from a batch file with a list of commands, .i.e., to put the class files in another directory, it doesn't work.

For example, here is an error line:

.\metadigm\util\PromptDialog.java:810: cannot resolve symbol

and here is the default regular expression copied from "Compile Java"

^\(\(\(\[^\]+\[^\]+\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):

file register 1
line register 4

I tried

^\([^:]*\):\([0-9]+\)

but it didn't work either.

Any ideas?

Thanks!

Linda
Alan Bellows

Re: Regular expression to match error ouput

Post by Alan Bellows »

I've got the exact same problem, and I haven't been able to track down a solution. Perhaps one of the TextPad developers might chime in?

AB
Jeff Epstein

Re: Regular expression to match error ouput

Post by Jeff Epstein »

Try this:

[\]\([a-zA-Z]+.java\):\([0-9]+\):

Where register 1 is the file, and register 2 is the line.
Jeff Epstein

Re: Regular expression to match error ouput

Post by Jeff Epstein »

You may want to replace [a-zA-Z] with [a-zA-Z0-9_] if those characters appear in your file names.
Alan Bellows

Re: Regular expression to match error ouput

Post by Alan Bellows »

Thanks man... I'll try that when I get home and let you know if it works.

AB
Alan Bellows

Re: Regular expression to match error ouput

Post by Alan Bellows »

Well, that one didn't work, but I scabbed this one together, which did work:

^([A-Za-z0-9_-]:[^:]+):([0-9]+):

...Note also that I have Textpad set up for POSIX regular expression syntax.

AB
Jim Garacci

Re: Regular expression to match error ouput

Post by Jim Garacci »

This is what I use

Regular expression: ^\([^:]*:[^:]*\):\([0-9]+\):

Registers of: File: 1, Line: 2
Post Reply