[英]Is it possible to use “Unicode character escape sequences” in verbatim string literals?
[英]How to use escape character in a verbatim string?
我可以在逐字字符串中使用\\ r,\\ n等转义字符吗
string pattern = @"(?<!</institution>\r\n)(?<!<institution-wrap>\r\n)<institution type";
现在,如果我尝试使用该模式进行搜索或搜索并替换,它将起作用还是将\\ r \\ n视为普通字符串? 我该如何解决?
在模式中,可以。 有关示例,请参见http://rextester.com/GHVMBZ97646 。 但是,在替换中,如果使用逐字字符串,则将反斜杠视为文字,如本问题所述 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.