RE sequence operator not working !?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
phochstr
Posts: 2
Joined: Fri Nov 05, 2010 8:14 am

RE sequence operator not working !?

Post 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
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You must use Replace All.
phochstr
Posts: 2
Joined: Fri Nov 05, 2010 8:14 am

Thanks...

Post by phochstr »

... so simple and such an effect :D.

Superb.
Post Reply