tobyink / p5-json-schema

1 stars 4 forks source link

Fixed email regex #8

Open Relequestual opened 9 years ago

Relequestual commented 9 years ago

The current regex for email will only return valid if the field only contains an @ symbol. Obivously this is wrong. I created an issue for it at https://github.com/tobyink/p5-json-schema/issues/7

umann commented 6 years ago

Instead of qr/^\S+@\S+.\S+$/, you probably meant qr/^\S+@\S+[.]\S+$/, i.e. escaped dot.

Also, https://spacetelescope.github.io/understanding-json-schema/reference/string.html states that email validation is according to https://tools.ietf.org/html/rfc5322#section-3.4.1

See https://stackoverflow.com/questions/13992403/regex-validation-of-email-addresses-according-to-rfc5321-rfc5322#answer-26989421