I am using the following regular expression to validate a comma delimited list of email addresses. It works great as long as the input is such that each email address does not have leading and trailing blanks. I would like to accept leading and trailing blanks for each email address within this list. How can I do this?
<asp:RegularExpressionValidator ID="emailAddressesListValidator" Display="Dynamic"
ControlToValidate="stringTextBox" runat="server" ForeColor="Red"
ErrorMessage="Invalid List. Please input a comma separated list of email addresses."
ValidationExpression="^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*([,])*)*$">
</asp:RegularExpressionValidator>
I was able to get it to work by changing the regular expression to the one below.