开发者

Email Regex Validator, not allowing "."

Hey I have the following Regex Validator

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="email"
                ErrorMessage="Email requires a vaild email address" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>

But its not allowing the follow mail e.clear@c开发者_运维技巧ompany.ie , I believe the issue is with the . before the @ symbol, but not sure how to update the regex to reflect this


Use this:

\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

This is the default regular expression provided with RegularExpressionValidator. Yours expression have a ' after 8th char. It seems to be invalid.


i think its working for e.clear@company.ie. But you are not given the validation group.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜