Reputation: 4971
I have a string which contains something like;
"<font color=\"Red\">"
I need a regular expression which will match on any color. I have tried the below regular expression with no luck. Does anyone have some suggestions?
string pattern = "/<font[^>]*>/";
string newTag = Regex.Replace(txt_htmlBody.Text, pattern, "<font color=\"Black\">");
Upvotes: 0
Views: 547
Reputation: 19423
Regular expressions in C# don't need pattern delimiters like PERL or PHP, so you need to change the pattern to:
string pattern = "<font[^>]*>";
^ ^
Notice the removed / from the expression
Upvotes: 6