I am performing email address validation with javascript in a razor view page. The regex I am going to use is similar to the one proposed at Validate email address in JavaScript?
However, because the regex contains an '@' character, I am getting parser error when try to run the web app.
my regex looks like
/^...otherpart @* ... other part$/
I tried to add an '@' character to make the in the origin regex ... @@* ..., this eliminated the compilation error but seems to make the regex stops working. (we have used it in another web app that does not use razor engine, so I know it works).
Is there any other way to escape the '@' character?