Rigorous rule matching

[url=]
[/url]


function
checkPhone(){
var

phone = document.getElementById(‘phone’

).value;
if

(! (/ ^ [1], [[3] [0-9]) | ([4] [5-9]) | ([5] [0, 3, 5-9]) | ([6] [5, 6]) | ([7] [0 to 8]) | ([8] [0-9]) | ([9],8,9 [1])) [0-9] {8} $/

. The test (phone))) {alert (

“Wrong phone number, please fill in again “);


    

return
false
;


}}
[url=]
[/url]






Simple matching

[url=]
[/url]


function
checkPhone(){
var

phone = document.getElementById(‘phone’

).value;
if

(! (/ ^ [1], [3-9]) [0-9] {9} $/

. The test (phone))) {alert (

“Wrong phone number. Please fill it out again.”

);
return
false
; }}
[url=]
[/url]