my $SaveUrl = qr{
($HttpUrl) # Match an HTTP URL . . .
(?{ $url = $^N }) # . . . and save to $url
}x;
$text =~ m{
http \s*=\s* ($SaveUrl)
| src \s*=\s* ($SaveUrl)
}xi;
-----------------------------------------------------------------------------
Copyright 1997-2024 Jeffrey Friedl