From 10be1692297104a5b9fb5e2b95ebea81b9e5d5ba Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 11 Oct 2015 22:30:18 +0200 Subject: [PATCH] Fixes #10 --- src/assets/js/general_functions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js index 0cb32008..82be0c96 100644 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -188,12 +188,14 @@ var GeneralFunctions = { * This method validates an email address. If the address is not on the proper * form then the result is FALSE. * + * @link http://stackoverflow.com/a/46181 + * * @param {string} email The email address to be checked. * @returns {bool} Returns the validation result. */ - validateEmail: function(email) { - var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; - return reg.test(email); + validateEmail: function (email) { + var re = /^(([^<>()[\]\\.,;:\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,}))$/; + return re.test(email); }, /**