开发者

regex 'literal' meaning in regex

is t开发者_C百科here a way to treat a section of your regex string 'as is'?

I.e. I want to match for the literal pattern: "[^*..@/w$[{" in some text (exaggerated example, but you see what I mean)... Can I just enclose the whole bit in something?


Use Regex.Escape.
See http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.escape.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜