I have a line that should contain a list of elements in the form, {0}, {1} and {2} are the lines, and I want to basically extract them.
I want to do this for part of the html parsing problem, and I heard that parsing html with regular expressions is bad. (Like here )
I'm not even sure how to do this with regular expressions.
This is how much 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;
}
Before my research found that I could be completely mistaken using regular expressions.
How do you do this using either the method I selected, or using the HTML parser?
source
share