How to Remove beginning xml to ending xml tags?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

How to Remove beginning xml to ending xml tags?

Post by karipay »

Hi I have this XML and would like to remove one element. Can anyone please help me.

Example. I want to remove tag2.
<tag1>abcde</tag1>
<tag2>fghij</tag2>
<tag3>klmno</tag3>

so my output should be like this.
<tag1>abcde</tag1>
<tag3>klmno</tag3>

Thanks in advance!
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Search for : <tag2>.*</tag2>
Replace with: NOTHING

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Post by karipay »

This worked! Thanks a lot!
Post Reply