Regular Expression For Multiple Email Id in Asp.net

Regular Expression For Multiple Email Id in Asp.net

Sometimes we need to check multiple email id separated by comma using Asp.net regular expression.
Solution is below:

<asp:TextBox ID=”txtEmailAddress”  runat=”server” ></asp:TextBox>

<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ runat=”server” ControlToValidate=”txtEmailAddress”
ErrorMessage=”Invalid email address.” ValidationExpression=”\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*”
CssClass=”NormalRed” Display=”Dynamic”></asp:RegularExpressionValidator>

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply