Closed wkubiak closed 8 years ago
Just started reviewing :)
:octocat: Sent from GH.
Thanks @wkubiak I merged it.
@wkubiak can you give me an example of email address that wasn't working? I would like to add it to the ValidatorTest.
Thanks @brunofarache.
Examples: liferay@ios.works someperson@italy.travel
I discovered this while implementing Liferay API communication in an app. The validator class didn't recognize a valid email address with a 4+ character TLD.
The regexp originally used is a bit too restrictive, especially with limiting the TLD to be between 2 and 4 characters long, which by today's standards isn't a good assumption. As proof, here's the current IANA list for TLDs: https://data.iana.org/TLD/tlds-alpha-by-domain.txt
Also, I checked the Android source code in Java and I noticed that a different, less restrictive pattern was used there.
In the proposed change, I decided to copy the Java code regexp and replaced the one used in the iOS version.