質問して申し訳ありませんが、正規表現コードの理解に関しては役に立ちません。
私が書いていないphpモジュールには、次の関数があります
function isURL($url = NULL) {
if($url==NULL) return false;
$protocol = '(http://|https://)';
$allowed = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)';
$regex = "^". $protocol . // must include the protocol
'(' . $allowed . '{1,63}\.)+'. // 1 or several sub domains with a max of 63 chars
'[a-z]' . '{2,6}'; // followed by a TLD
if(eregi($regex, $url)==true) return true;
else return false;
}
エレギを置き換えるために必要なものは何でも、親切な魂が私にその代わりのコードを与えることができますか