Trust-Anchor-Group / NeuroAccessMaui

Contains a Maui App for TAG Neuro-Access.
Other
4 stars 1 forks source link

Onboarding Email page Suggestions #53

Open berggrenmille opened 1 month ago

berggrenmille commented 1 month ago
PeterWaher commented 1 month ago

A regular expression that claims to be fully RFC 822-compliant can be found here:

https://pdw.ex-parrot.com/Mail-RFC822-Address.html

RFC 5322 is simpler, and generates a shorter RegEx:

https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression

In C#, it is simpler to check the validity of the address, by trying to instantiate a MailAddress:

try {
    address = new MailAddress(address).Address;
} catch(FormatException) {
    // address is invalid
}