Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How to remove the string if it has <Text></Text>,<Memo></Memo> but not </p><p> Which is empty and how to replace <![CDATA[<p></p><p> to <![CDATA[<p>#!/usr/bin/perl while($_ = <DATA>){ chomp; #print $_; s/<.+><\/.+>//g; s/<!\[CDATA\[<p><\/p><p>/<![CDATA[<p>/g; print "$_\n"; } __DATA__ <Text><p> <Text></Text> <Memo></Memo> <Text></p> <![CDATA[<p></p><p>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: delete and substitute
by GrandFather (Saint) on Dec 09, 2009 at 06:43 UTC | |
|
Re: delete and substitute
by Anonymous Monk on Dec 09, 2009 at 06:42 UTC | |
|
Re: delete and substitute
by doug (Pilgrim) on Dec 09, 2009 at 16:41 UTC | |
|
Re: delete and substitute
by vitoco (Hermit) on Dec 09, 2009 at 12:50 UTC | |
by Anonymous Monk on Dec 12, 2009 at 03:00 UTC |