Page 1 of 1

need help with regular expressions

Posted: Wed Sep 25, 2002 8:36 pm
by Piotr Szymczak
Hi,

I am trying to configure TextPad to work with Latex. I was following tips on www.textpad.com and everything works fine but
one thing is missing there. Namely, after compliation I would like TextPad
to jump to the right line in the source code after double-clicking it in the command results window. I know that one must insert correct "regular expression" into the tool menu, but unfortunately, I don't know the first thing about regular expressions. LateX output looks like this:

********************************************************

LaTeX Warning: Reference `sstate' on page 26 undefined on input line 893.

! Undefined control sequence.
l.960 \sectiona
{Introduction}

! Emergency stop.
\cite@adjust ... \@zero@skip \spacefactor
1001 \fi \ifnum \spacefacto...
l.974 ... known as chemotaxis~\cite{Narang}
. Corrosion of
********************************************************
where 893,960 and 974 are the line numbers I would like to
extract. Could anyone give me an idea how to do it?

Piotr

Re: need help with regular expressions

Posted: Thu Sep 26, 2002 6:47 am
by Andreas
Try this:

.*l\(\(ine \)\|\(\.\)\)\([0-9]+\).*

line register should be 4

Attention: not tested!

Explanation:
.* any stuff before/after the relevant part
\(\)\|\(\) match either the stuff in the first or the second \(\)
ine is the stuff for the first kind of errors
\. is a literal dot for the second kind of errors
\([0-9]+\) takes the line number

No guarantee for it to work!

Re: need help with regular expressions

Posted: Mon Sep 30, 2002 9:35 pm
by Piotr Szymczak
It's working!! (although the line register seems to be 3 and not 4)
Thanks!

Piotr

Re: need help with regular expressions

Posted: Tue Oct 01, 2002 10:27 am
by Andreas
Seems as if textpad counts the two alternative \(\)\|\(\) as one - as only one of them is ever considered...