Page 1 of 1

Change string into the same string in Regular Expression

Posted: Mon Jan 31, 2005 5:32 pm
by qq
I have to replace internal line of block of texts. They have few same lines but few are different.

Eg.

AAAA
10
xx
20
yy
30
BBBB

where xx, yy are variables.

Want to have at the end

AAAA
10
xx
20
yy
CCCC

I search with expression like:
AAAA\r\n10\r\n.*\r\n20\r\n.*\r\nBBBB\r\n

but have no idea what to put as result expression in places marked by !

AAAA\r\n10\r\n ! \r\n20\r\n ! \r\nCCCC\r\n

Posted: Mon Jan 31, 2005 5:32 pm
by qq
Now I know about () and $1 possibilities.
Thanks :)

Posted: Mon Jan 31, 2005 5:32 pm
by Abacre
Yes, you may use () and $1

Do you know about \1 ? :wink:

Posted: Mon Jan 31, 2005 5:32 pm
by qq
Not yet, hope I will know :D