Page 1 of 1

Search for lines and replace using regular expression

Posted: Sun Jul 05, 2009 10:47 am
by hotkee
Example line below

<item>Some Title text
<item>Some Different Title text

I would like to be able to search for all text like above and replace with

<item>Some Title Text<code>
<item>Some Different Title text<code>

Sounds simple - I can do a search using regular expression

<item>.*

That finds the lines, but when I try to do a replace using replace string

<item>.*<code>

I get

<item>.*<code>
<item>.*<code>

Cant figure it out so hope someone can help - TIA

Posted: Sun Jul 05, 2009 8:19 pm
by ben_josephs
Find what: <item>.*
Replace with: \0<code>

[X] Regular expression
Look in TextPad's help under
Reference Information | Regular Expressions,
Reference Information | Replacement Expressions and
How to... | Find and Replace Text | Use Regular Expressions.

thanks

Posted: Sun Jul 05, 2009 9:40 pm
by hotkee
Excellent - thanks for reply.