crazyboybert
Programmer
Hi All
This problem was raised in this forum in thread855-493222 but didnt seem to be addressed. I have a regex for say stripping attributes from tags something like..
Regex rxStriptAttributes = new Regex("(<\w+)[^>](>)"
all well and good as far as the regex doing the job. When i try and build this in VS.NET i get the error
"Unrecognized Escape Sequence"
caused by the regex special character '\w' as VS is obviously looking for a string escape not a regex special character. Now i can replace '\w' in this case with [a-zA-Z] but what if i wished to use \b or \n for a multiline match.....
Whats going on here - all the examples i see anywhere describe the use of special charcters in this way and none mention compilation problems. I am using all the correct namespaces and the code builds and runs fine if the '\w' is replaced. Is this VS 'bug' or am i missing something here?
Cheers
Rob
------------------------------------
Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon
------------------------------------
This problem was raised in this forum in thread855-493222 but didnt seem to be addressed. I have a regex for say stripping attributes from tags something like..
Regex rxStriptAttributes = new Regex("(<\w+)[^>](>)"
all well and good as far as the regex doing the job. When i try and build this in VS.NET i get the error
"Unrecognized Escape Sequence"
caused by the regex special character '\w' as VS is obviously looking for a string escape not a regex special character. Now i can replace '\w' in this case with [a-zA-Z] but what if i wished to use \b or \n for a multiline match.....
Whats going on here - all the examples i see anywhere describe the use of special charcters in this way and none mention compilation problems. I am using all the correct namespaces and the code builds and runs fine if the '\w' is replaced. Is this VS 'bug' or am i missing something here?
Cheers
Rob
------------------------------------
Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon
------------------------------------