tags:

views:

37

answers:

1

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, but you see what I mean)... Can I just enclose the whole bit in something?

+3  A: 

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

John Simons
Thankyou, I'll accept when it lets me.
Motig