jquense / yup

Dead simple Object schema validation
MIT License
22.93k stars 934 forks source link

Extending .string().email() to cover more cases. #2216

Closed cookieMonsterDev closed 2 months ago

cookieMonsterDev commented 6 months ago

The yup.string().email() works via regex but is does not cover cases like:

Can we update it? to something like:

/^(([^>()[\]\\.,;:\s@"]+(\.[^<()[]\.,;:\s@"]+)*)|.(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/

fgrotta commented 3 months ago

Also a@a pass the check

jquense commented 2 months ago

Tons of explanations in the repo for why this is the way it is. Yes it doesn't cover lots of cases, you are encouraged to customize the method to suit your needed