如何将其转换为 preg_match?
$urlregex = "(https?|ftp)://([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&;%$-]+)*@)*((?:(25[0-5]|2[0-4]\d|[01]\d{2}|[1-9]\d|[1-9])\.){3}(25[0-5]|2[0-4]\d|[01]\d{2}|[1-9]\d|[1-9]|0)|localhost|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:\d+)*(($|[a-zA-Z0-9.,?'+\\&;%\$#=~_-]+))*";
if (!eregi($urlregex, $_POST['url'])) {
$error = true;
$res = array(
'response' => 'error',
'message' => 'The URL you have entered is invalid.'
);
}