I have difficulties in C# using regular expressions. What I need to do is to find a specific string, and keep only a specific word in that string.
Here is my code :
reg = new Regex("<td></td><td><Span class=\"abc\"><Span style=\"color:#......;\"><B>(.*?)</td></tr>");
Here is the unique string I want to retrieve, since there can be different colors I put ...... (code color is always 6 characters), and the (.*?) is the specific word that I will want to save.
Then it goes like this :
this.varToSave = reg.Match(data).Value.Replace("<td></td><td><Span class=\"abc\"><Span style=\"color:#......;\"><B>", "").Replace("</td></tr>", "");
I want to erase everything and keep only my word (.*?), but it doesn't work. It only erases the ("", ""). I think it is a problem with the "......" in the replace code, but I don't know how to fix this.
Thanks in advance.