HELP!
i have an HTML page represented as one string.
im using the following code to extract a value out of one HTML tag, and it works. this pattern should match multiple times though because the string occurs 3 times in this html page. i can't figure out how to run this regular expression repeatedly until it cannot match any more items. in other words, i need to loop it somehow and each time i need to pick up at the point in the string where i left off... or something like that...
sub stripIt
{
my $tmp_pg = $_[0];
if ( $tmp_pg =~ /blue\">(.*?)<\/td/ )
{
print "---$1--- ";
}
}
Using the HTML parser package looks difficult. If its not difficult, can someone post a quickie example to get me started?
i have an HTML page represented as one string.
im using the following code to extract a value out of one HTML tag, and it works. this pattern should match multiple times though because the string occurs 3 times in this html page. i can't figure out how to run this regular expression repeatedly until it cannot match any more items. in other words, i need to loop it somehow and each time i need to pick up at the point in the string where i left off... or something like that...
sub stripIt
{
my $tmp_pg = $_[0];
if ( $tmp_pg =~ /blue\">(.*?)<\/td/ )
{
print "---$1--- ";
}
}
Using the HTML parser package looks difficult. If its not difficult, can someone post a quickie example to get me started?