in reply to Help with Regex: (Absolute/Relative URLs)

$text =~ s#src="(?!\w+://)([^"]*)"#src="$url$1"#ig;

There's no need to escape the quotes, and it's more efficient to change the .*? to [^"]*. Then you don't need the /s either.

Abigail

Replies are listed 'Best First'.
Re: Re: Help with Regex: (Absolute/Relative URLs)
by OverlordQ (Hermit) on Aug 05, 2003 at 21:48 UTC
    Ah, thank you. It's been ~2-3 years since the script has been written, so many reasons for doing it that way are probably forgotten.