I'm trying to replace c++
with <b>c++</b>
in the following string:
"Select the projects entry and then select VC++ directories. Select show"
I want it to be
"Select the projects entry and then select V<b>C++</b> directories. Select show"
Im using this code :
string cssOld = Regex.Replace(
"Select the projects entry and then select VC++ directories. Select show",
"c++", "<b>${0}</b>", RegexOptions.IgnoreCase);
I get the following error :
System.ArgumentException: parsing "c++" - Nested quantifier +.
This code works fine with other text(!c++). It seems like the + operator cause the Regex library to throw an exception.