I need check if the address email is correct in markup of my aspx page.
The possible address email correct is :
Name(AndAnyNumber).Surname(AndAnyNumber)@march.com
And I have tried this RegularExpressionValidator :
<asp:RegularExpressionValidator ID="retxtEmail" runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Not valid" Text="Not valid" Display="Dynamic"
ValidationExpression="^([a-z][a-z0-9]*\\.[a-z][a-z0-9]*@march\\.com)$"
SetFocusOnError="true" EnableClientScript="true"></asp:RegularExpressionValidator>
Withou success because for address email :
The return is Not valid, why ?
Can you please help me figure out the problem?
Thanks in advance.
"^([a-z][a-z0-9]*[.][a-z][a-z0-9]*@march[.]com)$"., but try with just the single slash. If that still doesn't work (for example, if asp.net adds the second slash for you) try @WiktorStribiżew suggestion above to escape using[.].