Help with regular expression

General questions about using TextPad

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

Post Reply
a4x4kiwi

Help with regular expression

Post by a4x4kiwi »

:roll: Hi,

I have been checking out Textpad for compiling JAL (a PIC microcontroller language).

I am having trouble working out the regular expression to go to a line containing errors.

Could someone assist in creating a regular expression to got to the file, line and colomn of the error please.

the error output looks like...

parsing Rc line 2640
parsing Rc line 2640
parsing Rc line 2640
parsing Rc line 2640
> error: type not known
> file 'C:\work\jal\Rc\Rc.jal' line 53 char 5
> : var by te togglebit = 0
> : ----^^

thanks afor any assistance,
Mal
Jens Hollmann
Posts: 26
Joined: Tue Mar 04, 2003 7:33 am

Post by Jens Hollmann »

Try

^> file '\(.*\)' line \([[:digit:]]+\) char \([[:digit:]]+\)

The file would be 1, line 2 and column 3 in the drop down lists below the regexp.

With this you should be able to jump to en error when you click on the lines looking like "> file 'C:\work\jal\Rc\Rc.jal' line 53 char 5".

Short explanation:
^ matches the line beginning
\(.*\) matches anything and marks it as sub-expression number 1
\([[:digit:]]+\) matches 1 or more digits and marks that as expr 2
And the same again at the end of the regexp.

The rest ist simple text that matches itself.

Mind that you must close the output-window so that changes in the tools section will take effect!

HTH

Jens
a4x4kiwi

Thanks

Post by a4x4kiwi »

Hi,

Thanks for the quick reply and assistance.

For some reason It didn't copy and paste. I ended up building the expression slowly. A good learning experiance.

Thanks again,
regards,
Mal
Post Reply