By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,550 Members | 2,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,550 IT Pros & Developers. It's quick & easy.

RegEx, replace if not inside tags

P: n/a

Hi

When using RegEx to replace a text within a string, how do I prevent it from
replacing the text if it's inside a tag...For example if I want to change
'small' to 'large' in the following text:

"This is <protect>a small test</protect> for a small application"

but only it it's NOT inside the 'protect' tags ??
Before replace:
"This is <protect>a small test</protect> for a small application"
replace small with larg...

After replace:
"This is <protect>a small test</protect> for a large application"

any help would be greatly appreciated....

TIA

Søren
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.