js verify mailbox format

     

Test function () {
var TEMP = document.getElementById ( " text1 " ); // verify the email is var MYREG = / ^ ([A-zA-Z0- . 9 ] + [_ | \ _ | \.]? ) * [A-zA-Z0- 9 ] + @ ([A-zA-Z0- 9 ] + [_ | \ _ |. \]?) * [A-zA-Z0- 9 .] + \ [A the Z--za] { 2 , . 3 } $ / ; IF (! myreg.test (temp.value)) { Alert ( ' prompt \ n \ n enter a valid E_mail! ' ); myreg.focus (); return false ; } } // Since the same manner, only the write bit associated regular expression // for verification phone number (provides two methods) var Mobile = / ^ (( 13 is [ 0 - . 9 ] { . 1 }) | 159 | 153 ) + \ D { . 8 } $ / ; var Mobile1 = / ^ ( 13 is + \ D { . 9 }) | ( 159 + \ D { . 8 }) | ( 153 + \ D { . 8 }) $ / ; / / for the verification code var phoneAreaNum = / ^ \ D { . 3 , . 4 } $ / ; // For the telephone number validation var Phone = / ^ \ D { . 7 , . 8 } $ /;

 

Guess you like

Origin www.cnblogs.com/wuliujun521/p/11544803.html