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.
> 
> 

HTML, particularly ugly HTML, is notoriously hard to parse with regexes.
Try an HTML parsing module instead.

http://search.cpan.org/perldoc?HTML::TokeParser::Simple

Then you'd more than likely have to loop over the structure until you
get to the end, then back up until you find a "P" and then forward from
there.

-- 
Brian J. Miller
End Point Corp.
br...@endpoint.com

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to