Reputation: 127
i need to escape the special characters, so i have checked the regex options like as below,
new Regex(@"^[\[email protected]]*$",RegexOptions.Compiled);
it's working fine for all special character except \n so how can i check it for all special character.
Upvotes: 1
Views: 85
Reputation: 1640
Use a negative lookahead assertion:
^[\[email protected]]*(?!\n)$
Demo.
Upvotes: 2