I've been using the ICSharp TextEditor control, and this uses an XML file to work out the different syntax highlighting sections (strings, comments etc.) with the C# regex engine.
So I've been using this Regex to match chord symbols (from this question):
\b[A-G](?:add|maj|j|m|\+|b|\#|sus|\d|°)*(?:\b|(?<=\#))
The problem is, the < symbol is part of XML syntax, so I substituted it with <, making it:
\b[A-G](?:add|maj|j|m|\+|b|\#|sus|\d|°)*(?:\b|(?<=\#))
The problem is, after doing this, the program crashes because of an invalid Regex. I've narrowed it down, and it's definately the < that's causing the problem.
So is there any other way of escaping the < angle bracket while still allowing the regex engine to use it.
The XML entity for
<
is<
and not<
.