0

I'm writing a program which has a email field. I want to put a restriction that only username@gmail.com emails would be valid. But when I try to run, my RegularExpression Validator gives me a mistake

This is the code I'm using:

<asp:TextBox ID="ExistMail" runat="server" ></asp:TextBox><font size='2'>
      <asp:RegularExpressionValidator ID="RegularExpressionValidator3" class="errorMess" runat="server" ErrorMessage="Invalid Email Address!!!" ControlToValidate="ExistMail"

      <ValidationExpression="\w+([-+.']\w+)*@\w+gmail.com\w+)*"></asp:RegularExpressionValidator>   
4

1 回答 1

1

删除 @ 后面的 \w+ 和字符串末尾的 \w+

\w+([-+.']\w+)*@gmail.com
于 2013-05-08T00:33:22.717 回答