Trying to validate a comma-separated email list in the textbox with asp:RegularExpressionValidator
, see below:
^([\w+.%-]+@[\w.-]+\.[A-Za-z]{2,})( *,+ *(?1))*( *,* *)$
The point about requiring a comma between groups, but not necessarily at the end is handled here - I'm mostly adding this as it includes a nice subgroup with the (?1)
so you only define the actual email address regex once, and then can muck about with delimiters.
Email address ref here: https://www.regular-expressions.info/email.html