Brian J. Miller wrote:
ekbworldwide wrote:
I want to remove the last paragraph tag and its contents.
From this:
_____________________________________________
<p>It feels, at least to me, a bit more like You-Tube</p> <p><em>Do
you
use the aspects of it? Or do you just plainly use it as a way to keep
posted on your RSS feeds?</em></p> <p><a rel="nofollow"
target="_blank"
href="http://www.site.com/">Buy an ad</a> right here. You are reading
this aren't you?</p> Similar Posts:
_____________________________________________
I want to remove this:
_____________________________________________
<p><a rel="nofollow" target="_blank"
href="http://www.site.com/">Buy an ad</a> right here. You are reading
this aren't you?</p>
_____________________________________________
How can I?
If you do provide an answer - could you explain how it works? My grab
of regex is very weak.
Then strengthen it.
http://perldoc.perl.org/perlretut.html
http://perldoc.perl.org/perlop.html#s/PATTERN/REPLACEMENT/msixpogce
HTML, particularly ugly HTML, is notoriously hard to parse with regexes.
Try an HTML parsing module instead.
Yeah, that's the standard answer, but in this case it looks like we are
dealing with an HTML part of a MIME message with an appended ad,
probably with varying content inside the <p></p> pair. If that's the
case, it's probably not a disaster if it would fail occasionally, and a
simple substitution may be sufficient:
s,(.+)<p.+</p>,$1,is
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/