Is there any helper function in (ASP).NET library that properly escapes .NET regex patterns to be used in javascript? So that i don’t need manually escape + quantifiers, etc. As far as i understand RegularExpressionAttribute from Data Annotations performs proper translation. Can i reuse it somehow?
Is there any helper function in (ASP).NET library that properly escapes .NET regex patterns
Share
Escape() is your friend:
Turns, for instance,
"a+b"into"a\+b".