Given the following codes and my input is new@[email protected]
this one returns false
VB.NET Code:
<asp:RegularExpressionValidator
ID="REV1"
runat="server"
Display="Static"
ErrorMessage="Error."
ControlToValidate="txtEmailAdd"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
but this one returns true
VB.NET Code:
Dim myMatch As Match = System.Text.RegularExpressions.Regex.Match(txtEmailAdd.Text, "\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")
If Not myMatch.Success Then
Result.Text = "Error."
Exit Sub
End If
can anyone tell me what's wrong? Thanks in advance.