Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed regex to accept Top-level domain with length 63 #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jqBootstrapValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@
name: "email",
init: function ($this, name) {
var result = {};
result.regex = regexFromString('[a-zA-Z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}');
result.regex = regexFromString('[a-zA-Z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,63}');

var message = "Not a valid email address";
if ($this.data("validation" + name + "Message")) {
Expand Down
3 changes: 2 additions & 1 deletion test/jqBootstrapValidation_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
'!def!xyz%abc@example.com',
'_somename@example.com',
'test@example.com',
'\u2019test\u2019@example.com'
'\u2019test\u2019@example.com',
'someone@tld63char.abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabc'
];
test('accepts valid', validEmails.length * numInJQBVTest, function() {
$(validEmails).each(function (i, el) {
Expand Down