Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If character<p></p> # For the character <.
exists at the end of the character <.'>'
#!/usr/bin/perl while (<DATA>) { if($_ =~ /<.+>(<.+>)(.*)/){ $output = $1.$2; $output =~ s/(<|\\)/<\/p><p>/g; print $output; } } __DATA__ <BODY><![CDATA[<p>Developmentally, 2-year-olds are generally more inte +rested in themselves, while dogs do care how their people feel, and i +nstantly recognize a change in emotion.< "While your dog can't compre +hend that you just received a traffic violation, he can tell that you +'re upset the second you walk through the door," Coren says. "In fact +, dogs can detect some subtle changes which even adults can't," adds +Coren. "We can't smell cancer or predict seizures, as dogs can."< Whe +n I posted this story on my Facebook Fan page recently (<a href="http +://www.new.facebook.com/pages/ Steve-Dale/50057343596?ref=ts">www.new +.f acebook.com/pages/Steve-Dale/50057343596?ref=ts, or simply type St +eve Dale into the Facebook search), I received some interesting respo +nses:< Kelle: "Heck, my Italian Greyhound is smarter than most colleg +e students."< Karen: "Depends on how you define smart.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: p tag substitution
by GrandFather (Saint) on Oct 15, 2009 at 08:01 UTC | |
by Anonymous Monk on Oct 15, 2009 at 08:30 UTC | |
by GrandFather (Saint) on Oct 15, 2009 at 08:46 UTC | |
|
Re: p tag substitution
by Marshall (Canon) on Oct 15, 2009 at 10:48 UTC | |
|
Re: p tag substitution
by ww (Archbishop) on Oct 15, 2009 at 12:29 UTC |