Skip to content

Commit acc4675

Browse files
committed
Better email validation
Currently "123@gmail" validates as true. The new regex fixes that. Source: http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
1 parent 3f841f4 commit acc4675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/languages/jquery.validationEngine-en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
},
8383
"email": {
8484
// HTML5 compatible email regex ( http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html# e-mail-state-%28type=email%29 )
85-
"regex": /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
85+
"regex": /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
8686
"alertText": "* Invalid email address"
8787
},
8888
"integer": {

0 commit comments

Comments
 (0)