I am trying to validate a phone number in the format (###)###-#### with \([0-9]{3}\)[0-9]{3}-[0-9]{4} in visual studio using the regular expression validator. I am receiving the error message with (111)111-1111. Yet when I do this on a regex testing site it works fine. Is there something else at play here that I am missing?
<asp:RegularExpressionValidator
ID="PhoneValidator"
runat="server"
ErrorMessage="Phone Format Must Be (###)###-####"
ValidationExpression="/\([0-9]{3}\)[0-9]{3}-[0-9]{4}/g"
Display="None"
ControlToValidate="PhoneTextBox">
</asp:RegularExpressionValidator>
/pattern/g, which appears to be interpreted as part of the pattern instead of as a regex directive.