Regex inside validator/core.js Question

Hi All,

I have been investigating some issues around the email validation and the regex in the validator/core.js file. Mainly because I am tailoring my SPA to only accept emails valid to the RFC 5321 and RFC 5322 SMTP protocol.

I'm not raising as a bug as it may not be, but would be good to get some clarification.

Would anyone be able to explain to me why the regex after the 'const reEmai' is formatted differently to all the other patterns also using lots of Unicode and special characters?

And if possible it would be great to know which protocol this matches to as it seems very specific!

Many thanks in advance!

@Teodor @patrick @Hyperbytes Would anyone be able to advise please?

I am certainly no expert on regex but i would guess unicode is used to allow for non standard latin characters containing accents etc.

This post may help

Thanks @Hyperbytes

I understand the regex, but just wondering which standard it is meant to be hitting, but also as to why it looks to be formatted incorrectly in the core file. Might request to have a feature to choose which email (and other data types?) standard they are meeting. Similar to how we can currently choose the type of SHA to use as an example of something similar.