This PR implements a new action for RFC 5322 based email address validation. A few things are of particular importance.
The regex used in this PR was taken from the HTML living standard and has a few willful violations of RFC 5322
It is impossible and unrealistic to parse a fully RFC compliant email address with a regular expression, as the spec allows for comments, which are made of balanced potentially nested parenthesis pairs. However, email clients such as Gmail don't accept these addresses either
If the willful violations are not acceptable, it is likely that parsing an address without a regex is a better choice.
I opted to reuse the types, reference and type of the default email action so that there is just a single case for i18n messages. I'm not sure if that approach is ideal, but I'd be happy to change it.
I'll add documentation after this question is answered as not to duplicate the work.
Thank you for creating this PR! I would not reuse email and create a brand new action instead, as I think this makes the library simpler. We have never reused an action in this way.
This PR implements a new action for RFC 5322 based email address validation. A few things are of particular importance.
I opted to reuse the types, reference and
type
of the defaultemail
action so that there is just a single case for i18n messages. I'm not sure if that approach is ideal, but I'd be happy to change it. I'll add documentation after this question is answered as not to duplicate the work.Fix #204