Domain name regular matching expression that can be used js version, php version
Domain name information under php section
Function is_domain ($domain)
{
If (preg_match ("/ ^) ([0-9aSumz -] {1,}.)? [0-9aMuz -] {2,}. ([0-9aMuz -] {2,}.)? [aMuz] {2,} $/ I", $domain)
{
Return true
}
Else
{
Return false
}
}
Domain name regular expression js version
Function doseo () {
If (! $('domain'). Value.match (/ ^ ([a-z0-9 -] {1,}.)? [a-z0-9 -] {2,}. ([a-z0-9 -] {1,}.)? [a-z0-9] {2,} $/ I)) {
Alert ('Hello ~ ~ first of all, please enter the correct domain name: P')
$('domain'). Value ='
$('domain') .focus ()
Return
}