PDA

View Full Version : Ext.form.VTypes email regexp



corey.gilmore
16 Apr 2007, 2:54 PM
The email regexp in Ext.form.VTypes is probably a bit too restrictive by default, only working with domains matching domain.tld. Domains like user@host.co.uk or user@some-host.com won't match.
Currently:

var email = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,4}){1,2}$/;

This will allow more subdomains, hyphens in the subdomain and only letters in the TLD/country code:

var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;

jack.slocum
16 Apr 2007, 11:23 PM
Thanks Corey. :)

svenna
14 Jun 2009, 8:09 AM
Will you please make a less restrictive VType in the next public release?

http://www.extjs.com/deploy/dev/examples/form/dynamic.html
Will not validate mail-me@sventore.com (due to the "-")

tryanDLS
14 Jun 2009, 3:02 PM
Please don't resurrect old threads to ask for something in an unsupported version. I suggest you search a little - there have been a number of discussions and modifications made to the email vtype in the 3.0 codebase.