while() { m!(https?://[^"'>\s]+)! or next; $url = $1; $url =~ s/--$//; print "$url\n"; } __DATA__