-
6 Mar 2009 2:35 AM #1
[2.2.1] Regression: Email Validator validates correct mail addresses as false
[2.2.1] Regression: Email Validator validates correct mail addresses as false
In Ext 2.2.1 the email-validator was changed a little bit to fix hanging browsers. (As explained in the changelog)
Unfortunatly this also broke validation for some valid emails. All emails containting a dash (-) are now not validated as correct email addresses.
You can easily check this behaviour in the form example page:
http://extjs.com/deploy/dev/examples/form/dynamic.html
Enter the valid address: test.test@example.com - all ok
Enter the valid address: test-test@example.com - not validated as correct email.
You can check in an example of Ext 2.2 the email test-test@example.com correctly passes validation.
I tried to fix the bug myself changing the regular expression and undoing one of the added slashes of the change from 2.2 to 2.2.1, but that did not fix the Bug. I'm also not a RegExp guru, and don't know which bugs in browser where corrected by the change introduced in 2.2.1.
Could anybody provide a fixed RegExp?
-
15 Mar 2009 3:54 PM #2
Confirms this bug. I don't know why is that, but we can hope that v3 will be released sooner or later
72
-
15 Mar 2009 10:06 PM #3
try this regExp
Code:/^([\w\-]+)(\.[\w]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;Shibu Bhattarai
Use JavaScript beautifier to beautify you code http://jsbeautifier.org/
Code Conventions http://javascript.crockford.com/code.html
ExtJS Core Manual http://extjs.com/products/extcore/manual/
-
15 Mar 2009 10:52 PM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Not exactly.
The Ext 2.2 regexp was:
(the . wildcard was obviously wrong)Code:var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;
This was fixed in Ext 2.2.1 by prefixing the . with a \:
The only problem is that it now only allows word characters (A-Za-z0-9_) a no other characters (!#$%&'*+-/=?^`{|}~). Of these characters at least - should be supported:Code:var email = /^([\w]+)(\.[\w]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;
Code:var email = /^([\w\-]+)(\.[\w\-]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;
-
25 Mar 2009 4:29 AM #5
More accurate
More accurate
Here is a regular expression pulled from a larger, more RFC correct regex that should suffice for nearly all real world email addresses:
I pulled out support forCode:^(?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+@((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}$type emails as well as theCode:"my name" <my_email@domain.com>
format to simplify things.Code:email@[120.90.90.120]
-
6 Aug 2009 9:06 PM #6
Help !!! email validation using regex
Help !!! email validation using regex
i hab a problem with email validation using regex... m fine with email validation for emails like:
abc.xyz_123-abc@something.com
but the problem is i have to allow character ' too... bt i donno what will be regex.
example of email can be:
abc_123-abc's.nepal@something.com
i need help ..
-
6 Aug 2009 9:31 PM #7
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
6 Aug 2009 10:03 PM #8
solution to regex email validation
solution to regex email validation
i found the solution to email validation for email such as
abc.123-abc'nepal@mavendeveloper.com
the solution to this is
regex :/^([\w\-\'\-]+)(\.[\w-\'\-]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/
http://www.mavendeveloper.com
Last edited by raj_zero1; 31 Mar 2010 at 8:36 AM. Reason: spelling mistake in url
-
15 Oct 2009 5:29 AM #9
Looks like this is still not fixed in 2.3.0 and 3.0.0
-
15 Oct 2009 5:31 AM #10
And we have two valid TLDs with 6 chars now - .travel and .museum


Reply With Quote

