[英]regex matches \n in c#
i need to escape the special characters, so i have checked the regex options like as below, new Regex(@"^[\\w@.-]*$",RegexOptions.Compiled);
我需要转义特殊字符,因此我已经检查了如下正则表达式选项,即
new Regex(@"^[\\w@.-]*$",RegexOptions.Compiled);
it's working fine for all special character except \\n so how can i check it for all special character. 对于\\ n以外的所有特殊字符,它都工作正常,因此我如何检查所有特殊字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.