Skip to content
Snippets Groups Projects
Commit 044dc143 authored by xiyuan@chromium.org's avatar xiyuan@chromium.org
Browse files

Allow hypen in domain name of email address for ChromeOS users UI.

Change '\w+' to [A-Za-z0-9]{2,63} in email address regexp. This allows
hypen to be used in domain name part of an email and sets a 2-63 chars
length limit.

Use the same email alias pattern for format3 as in format1 and format2.

BUG=chromium-os:10250
TEST=Verify fix for chromim-os:10250.

Review URL: http://codereview.chromium.org/5812004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69153 0039d316-1c4b-4281-b951-d872f2087c98
parent 24ebb8c8
No related branches found
No related tags found
No related merge requests found
...@@ -14,12 +14,15 @@ cr.define('options.accounts', function() { ...@@ -14,12 +14,15 @@ cr.define('options.accounts', function() {
// e.g. 'john@chromium.org' // e.g. 'john@chromium.org'
// {name: 'john', email: 'john@chromium.org'} // {name: 'john', email: 'john@chromium.org'}
const format2String = const format2String =
'^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@(\\w+\\..+)\\s*$'; '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@' +
'([A-Za-z0-9\-]{2,63}\\..+)\\s*$';
// Full format. // Full format.
// e.g. '"John Doe" <john@chromium.org>' // e.g. '"John Doe" <john@chromium.org>'
// {name: 'John doe', email: 'john@chromium.org'} // {name: 'John doe', email: 'john@chromium.org'}
const format3String = const format3String =
'^\\s*"{0,1}([^"]+)"{0,1}\\s*<([^@]+@\\w+\\..+)>\\s*$'; '^\\s*"{0,1}([^"]+)"{0,1}\\s*' +
'<([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+@' +
'[A-Za-z0-9\-]{2,63}\\..+)>\\s*$';
/** /**
* Creates a new user name edit element. * Creates a new user name edit element.
......
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