Esri / geoform-template-js

GeoForm is a configurable template for form based data editing of a Feature Service.
http://esri.github.io/geoform-template-js/
Apache License 2.0
67 stars 83 forks source link

Email validation regex is too strict #461

Closed davetimmins closed 9 years ago

davetimmins commented 9 years ago

The current email validation regex is too simplistic and is flagged valid email addresses as invalid. For example, we have users' with email addresses such as blah@blah.info but the current regex for validation https://github.com/Esri/geoform-template-js/blob/development/js/main.js#L1283 only allows a maximum of 3 characters for the top level domain.

I know the RFC's for this are painful but I think something less strict that allows a broader set of matches would be beneficial. Something like

email = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/