Page 1 of 1

RE sequence operator not working !?

Posted: Fri Nov 05, 2010 8:30 am
by phochstr
Hi

I'm trying to insert a sequence number into a file consisting of lines containing SQL statements.

I have enabled POSIX style REs in TP 5.4 or 5.3.1.

The interesting part of my data is:

Code: Select all

(1234567, 123);
which I would like to replace with:

Code: Select all

(1234567, <sequence number>, 123);
So, I search for

Code: Select all

\(([0-9]*), ([0-9]*)\);
which I tell TP to replace with

Code: Select all

(\1, \i, \2);
I also tried the \i(1) and \i(1,1) syntax variants.

All of them invariably return:

Code: Select all

(1234567, 1, 123);
... (2345678, 1, 231);
...  (3456789, 1, 231);
So, the "sequence" is always a 1 and never incremented. What am I doing wrong?

Thanks
Peter

Posted: Fri Nov 05, 2010 10:25 am
by ben_josephs
You must use Replace All.

Thanks...

Posted: Fri Nov 05, 2010 11:03 am
by phochstr
... so simple and such an effect :D.

Superb.