when I use MVC 3 with a razor, it works fine, but when I write a regular expression using @section head {} they donβt work
function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([az]{2,6}(?:\.[az]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); }
it has @ so give me an error that
Parser Error: An error occurred while parsing the resource needed to service this request. Review the following parsing error details and modify the source file accordingly. The error message Parser: "\" is not valid at the beginning of the code block. Only identifiers, keywords, comments, "(" and "{" are valid.
Steven spielberg
source share