Regex pattern

Started by
-1 comments, last by chbfiv 16 years, 8 months ago
I'm using RegexDesigner.NET to make some patterns to color my XML document in a RichTextBox. This is the pattern that works in the designer

=(\".*?\"|\'.*?\'|\b(\w|-)+\b) //which is the same as this
=(".*?"|'.*?'|\b(\w|-)+\b) // which selects 
="some text in an xml attribute" //or
='some text in an xml attribute'



All of my other patterns for tags, comments, and such work except this one.

"=(".*?"|'.*?'|\b(\w|-)+\b)"



where i get an unrecognized escape seq. \w So I tried all of these:

 "=(\".*?\"|\'.*?\'|\b(\w|-)+\b)" //unrecognized escape seq. \w
@"=(".*?"|'.*?'|\b(\w|-)+\b)" //does nothing




I'm clearly all jacked up with my string literals and when its going to convert it here, and turn it into a quote there.... I'm using the pattern in C#. Any ideas?
-BourkeIV

This topic is closed to new replies.

Advertisement