in reply to Problem with parsing HTML with Regex's
Which doesn't seem to work very well as I'm getting some rather strange output. TIA.Such as?
Parsing html (which is what you're trying to do) with regular expressions is hard (more so when you're green). But as usual, there is always CPAN (HTML::StripScripts::Regex, YAPE::HTML )
use Regexp::Common qw /delimited/; my $text = q~ qqq <img src = "src" > sss <img src='src' > ~; $text =~ s~ img \s+ src \s* \= \s* (?: $RE{delimited}{-delim=>'"'} | $RE{delimited}{-delim=>"'"} ) ~bongo~sigx; print $text,$/,$/; __END__ qqq <bongo > sss <bongo >
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem with parsing HTML with Regex's
by OverlordQ (Hermit) on Nov 10, 2003 at 07:51 UTC |