I have a string that should contain a list of items in the form , {0}, {1}, and {2} are strings and I want to basically extract them.
I do want to do this for part of an html parsing problem, and I have heard that parsing html with regular expressions is bad. (Like here)
I am not even sure how to do this with regular expressions.
This is as far as I got
string format = "<link rel=\".*\" type=\".*\" href=\".*\">";
Regex reg = new Regex(format);
MatchCollection matches = reg.Matches(input, 0);
foreach (Match match in matches)
{
string rel = string.Empty;
string type = string.Empty;
string href = string.Empty;
//not sure what to do here to get these values for each from the match
}
Before my research turned up that I might be completely on the wrong track using regular expressions.
How would you do this either with the method I chose or with an HTML parser?