Skip to content
Snippets Groups Projects
Commit 0a251baa authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Got a shorter version of the email RegExp from Gerv

issue #501
parent 37c3bbe2
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,10 @@ BrowserID.Validation = (function() {
bid.verifyEmail = function(address) {
// Original gotten from http://blog.gerv.net/2011/05/html5_email_address_regexp/
// changed the requirement that there must be a ldh-str because BrowserID
// is only used on internet based networks. Also modified to allow capital
// letters in the domain name.
// is only used on internet based networks.
var parts = address.split("@");
return /^[\w.!#$%&'*+\-/=?\^`{|}~]+@[a-zA-Z\d-]+(\.[a-zA-Z\d-]+)+$/.test(address)
return /^[\w.!#$%&'*+\-/=?\^`{|}~]+@[a-z\d-]+(\.[a-z\d-]+)+$/i.test(address)
// total address allwed to be 254 bytes long
&& address.length <= 254
// local side only allowed to be 64 bytes long
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment