<ch***********@gmail.comwrote:
since < has a meaning in c# for regular expressions and \< says it's
an unrecognized escape sequence, I'm pretty lost parsing html tags
without replacing them first with another character or string.
Does anyone have a hint for me on how to get c# Regex class to find
"<"?
You need to differentiate between the escaping that C# is involved in,
and escaping that regular expressions need.
The two simplest ways of expressing the string consisting of a
backslash and an open angle bracket are:
"\\<"
This uses \\ to form a single backslash in the string, using normal C#
escaping. The single backslash is used to escape the angle bracket from
the point of view of the regex.
@"\<"
This uses a C# verbatim string literal to represent the same string -
again, so the single backslash is used to escape the angle bracket.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
World class .NET training in the UK:
http://iterativetraining.co.uk