Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: delete and substitute

by vitoco (Friar)
on Dec 09, 2009 at 12:50 UTC ( #811913=note: print w/ replies, xml ) Need Help??


in reply to delete and substitute

Your sample data doesn't seem to be valid XML, so XML modules will fail.

Try the following line as a replace for both of yours:

s/<(\w+)>\s*<\/\1>//g;

Beware that this won't remove two "adjacent" tags from different lines, because you are processing one line at a time.


Comment on Re: delete and substitute
Download Code
Re^2: delete and substitute
by Anonymous Monk on Dec 12, 2009 at 03:00 UTC
    This person keeps switching from HTML to XML, all trying to edit with regex, every time question changes by little bit

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2014-09-15 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls