validation - In Grails, how to allow newer DNS in email validator constraint? -
static constraints = { email email:true }
this constraint treats test@email.wtf invalid. how allow newer dns '.wtf' valid email?
i create customemailvalidator extending org.apache.commons.validator.routines.emailvalidator
, using class similar org.codehaus.groovy.grails.validation.routines.domainvalidator
additional dns.
but there simpler way it?
if ok not matching new domains specifically, relax email rules this:
static constraints = { email(matches: '^\\w+@[a-za-z_]+?\\.[a-za-z]{2,63}$') }
Comments
Post a Comment