in reply to Problem with parsing HTML with Regex's

I already gave you an expression in the chatterbox. Its as close as I think you'll get without the use of some module (which is a really good idea, BTW).

s( ((?#1) # Capture the entire tag beginning <img(?s:.+?) src\s*=\s* # Optional space ((?#2)['"]) # Capture the delimiter ((?#3)(?s:.*?)) # Capture the URL \2 # Use whatever delimiter was used to start the URL ) { "$1$2" . resolveimg( $3 ) . $2 }gixe

Replies are listed 'Best First'.
Re: Re: Problem with parsing HTML with Regex's
by OverlordQ (Hermit) on Nov 10, 2003 at 07:43 UTC
    Doesn't that basically do the exact same as: $text =~ s#src=\"(.*?)\"#&resolveimg($1)#sige; ? And that wasn't the problem, the problem was the stylesheet links.