I have defined a tool to call our compiler but I am struggling to write an expression that will allow me to double click on an error in the output and take me to the file and line containing the error.
Our errors are output in the format :-
C:\TEMP\PROG1.CBL, line 238: Undefined data item: WSWROPN-LINKAGE1
What I need to extract is the file as PROG1.CBL (loosing the path) and the line number as 238.
Can anyone help me with the correct expression to add to the tool preferences.
Thanks,
Richard
Regular Expressions to match output.
Moderators: AmigoJack, bbadmin, helios, MudGuard
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
This works for the single line you posted as a sample:
Regex ^.*\\(.+\....), line ([0-9]{1,5}): .*$
where the file name is \1 and the line number is \2, ie. registers are 1 and 2.
Note that I always look for a file ending of three letters, the (.+\....).
I use POSIX regular expression syntax, which can be selected from the
Editor page of the Preferences dialog box. HTH
Regex ^.*\\(.+\....), line ([0-9]{1,5}): .*$
where the file name is \1 and the line number is \2, ie. registers are 1 and 2.
Note that I always look for a file ending of three letters, the (.+\....).
I use POSIX regular expression syntax, which can be selected from the
Editor page of the Preferences dialog box. HTH
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be