$text =~ s{
\b
# Capture the URL to $1 . . .
(
http:// [-a-z0-9]+(\.[-a-z0-9]+)*\.(com|edu|info) \b # hostname
(
/ [-a-z0-9_:\@&?=+,.!/~*'%\$]* # optional path
)?
)
}{$1}gix;
-----------------------------------------------------------------------------
Copyright 1997-2024 Jeffrey Friedl