Page 1 of 1

Replacing with Regular Expressions

Posted: Tue Jun 04, 2002 6:03 pm
by Miguel
How can I use textpad to replace the string:

AB

with the following string:

XAYBZ

where A, and B are two RE's and X, Y, Z are literal strings?
For example:
A: [a-z]*y
B: [a-z]*z
X: start
Y: middle
Z: finish

Re: Replacing with Regular Expressions

Posted: Tue Jun 04, 2002 9:49 pm
by N. Demos
A: [a-z]*y
B: [a-z]*z
X: start
Y: middle
Z: finish

Find String: \([a-z]*y\)\([a-z]*z\)
Replace String: start\1middle\2finish

More Generally (for the same situation above):
Find String: \(A\)\(B\)
Replace String: X\1Y\2Z

Re: Replacing with Regular Expressions

Posted: Fri Jun 07, 2002 8:15 pm
by Miguel
Thanks a lot!