Open spotlesscoder opened 4 months ago
I find this kind of implementation more straight forward than the current one https://github.com/apache/commons-validator/blob/master/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
also, this could be re-used in the sense to have a "domain" validator (they use a separate validator to validate the email's domain part that could also be used to validate a domain string on it's own) also, they provide a lot of test cases you might want to add to your tests as well: https://github.com/apache/commons-validator/blob/master/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java#L56
I kind of like matching the HTML validation, what would we get by changing the implementation?
I find this kind of implementation more straight forward than the current one https://github.com/apache/commons-validator/blob/master/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
also, this could be re-used in the sense to have a "domain" validator (they use a separate validator to validate the email's domain part that could also be used to validate a domain string on it's own) also, they provide a lot of test cases you might want to add to your tests as well: https://github.com/apache/commons-validator/blob/master/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java#L56