I’ve been trying to solve these problem for last two hours but seems like I can’t find any solution.
I need to extract links from an HTML file. There are 100+ links, but only 25 of them are valid.
Valid links are placed inside
<td><a href=" (link) ">
First I had (and still have) a problem with double quotes inside verbatim strings. So, I have replaced verbatim with “normal” strings so I can use \” for ” but the problem is that this Regex I have written doesn’t work
Match LinksTemp = Regex.Match(
htmlCode,
"<td><a href=\"(.*)\">",
RegexOptions.IgnoreCase);
as I get "<td><a href="http://www.google.com"> as output instead of http://www.google.com
Anyone know how can I solve this problem and how can I use double quotes inside of verbatim strings (example @” <>”das”sa “)
Escaped double quotes sample:
@"some""test"Regex sample:
"<a href=\"(.*?)\">"Also you may want to use
Regex.Matches(...)instead ofRegex.Match(...)