Replace expression with itself + string

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
kongharald
Posts: 3
Joined: Sat Oct 11, 2003 7:17 pm
Contact:

Replace expression with itself + string

Post by kongharald »

If I try to do a RegExp replace and want to insert the search expression into the replace expression TextPad inserts "\1" or "\2" litteraly as replacement text, not the search expression from the Find form.

What am I doing wrong?
(tried both Posix and non-posix searches)
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Have you ticked the "Regular Expression" Condition in the Replace dialog box?
Helios Software Solutions
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

\1 and \2 refer to the first and second tagged expression - i.e. parts in the search regex in ()

To use the complete string that was found use & or \0

And, of course, you have to have turned on Regular Expressions.
Post Reply