in reply to regex: something...(!something)...something

See HTML::Element ( replace_with_content method ) and HTML::TreeBuilder

#!/usr/bin/perl -w use strict; use HTML::TreeBuilder; my $html = q{<tr><td>1</td><td>2</td><td><font>3</font></td><td>4</td><tr>}; my $tree = HTML::TreeBuilder->new_from_content($html); my $td = $tree->look_down( '_tag', 'td', sub { $_[0]->as_text =~ m/\b3/ }); $td->replace_with_content(); $tree->delete;

hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: regex: something...(!something)...something
by aaaone (Initiate) on Jul 18, 2008 at 12:56 UTC
    It looks like XPath brother for html) thank you, I think I'll use this solution when I'll work directly with HTML code. For the solution please see the question of the topic - I added solution there.