How can I escape html codes in Regex?
I need to find the string
&
in a string like
this is my string & this is another string
I can not use HtmlEncode/Decode for this purpose cause i need work with tags. That i want i just find the common string.
I use this, and work for example with "another" or "my" but doesn't work with "&"
.
Regex regularextest = new Regex("\b&\b", options);
string RSTest = "char $& morechar";
string lalala = regularextest.Replace("foo & bar", RSTest);
It's very frustrating because google replaces the string with an & or "AND" word.
Thanks in advance