View Full Version : Ext.data.validator.Email regex default needs updating

18 May 2017, 5:33 AM

Ext JS 6.2.x & 6.5.x both say that the default validator regex for Email is;

/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+\/=?\^_`{|}~]))*\[email protected](\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/

The last {2,6} won't cope with the newer TLDs like .technology for example. Probably needs to be {2,63} to cope with these.

The length of any one section is limited to between 1 and 63 chars. A full domain name is limited to 255 chars including the separators.

I have no idea what happens if you encounter a domain name using Japanese Kanji/Katakana/Hiragana script :-)


Gary Schlosberg
20 Jun 2017, 3:56 PM
Thanks for the report. I found a similar ticket for this issue (EXTJS-22456) and it's been marked Won't Fix. Basically, the point of the validator is to catch simple cases, and if one needs to match exactly they can configure a custom validator using the 'matcher' config.

20 Jun 2017, 9:32 PM
Hi Gary

I did a quick search and couldn't find any references to the bug. This stuff would be much easier if we could see the bug list I'd have spotted EXTJS-22456 already existed and saved you a little bit of work.

The "Wont fix" bemuses me a little as it effectively makes the validator useless for anything which accepts public email addresses. Although possibly ok for an internal corporate app in a controlled space though.

By simply enlarging the final {2,6} to {2,63} that should cope with everything most of us will see. Anyone in the world who doesn't natively use the basic latin alphabet will probably be more aware of the complexities that involves.