Before that, we will talk about using js for email address verification. Next I will introduce you to using jquery's test exec to implement regular expression verification of email addresses. If you need it, please refer to it.
1. test Method
The Code is as follows: |
Copy code |
Reg =/^ w {3,} @ w + (. w +) + $ /; If (! Reg. test (obj )){ $ ("# Test" pai.html ("<B> enter the correct email address </B> "); } |
2.exe c method
The Code is as follows: |
Copy code |
$. FormatDate. patternParts =/^ (yy )? | M (M )?)?)? | D (d )? | EEE (E )? | A | H (H )? | H (h )? | M (m )? | S (s )? | S )/; Var matched = pai.formatdate.patternparts.exe c (pattern ); If (matched ){ // If matched is used as the array index: 0, it is used as the matching item. Otherwise, it is null. Result. push ($. formatDate. patternValue [matched [0]. call (this, date )); Pattern = pattern. slice (matched [0]. length ); } |