regex 'literal' meaning in regex

前端 未结 1 1801
北荒
北荒 2021-01-19 15:30

is there 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, b

相关标签:
1条回答
  • 2021-01-19 15:45

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

    0 讨论(0)
提交回复
热议问题