.
当www
旁边的规则正常工作时,我的 url 验证正则表达式允许超过 1 个。你能明白为什么以及如何解决它吗?并随时评论我的正则表达式
function isurl($this_url)
{
if(preg_match("/^((http|https):\/{2})+([w]{3})+([\.]{1})+([a-zA-Z0-9-]+)+([\.]{1})+((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)|(c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]|(g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)|(j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]|(m[acdghklmnopqrstuvwxyz]|mil|mobi|museum)|(n[acefgilopruz]|name|net)|(om|org)|(p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]|(t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw])$/i", $this_url))
{
return true;
}
}
$this_url = "http://www..domain.com";
if (isurl($this_url))
{echo "Success";}
else
{echo "Fail";}