As it's been commented by others, it might not be a good practice trying to parse HTML with regexes, but this is what you'd asked for. So here we go:
Regular Expression for `link` tag
@"(?ix)" +
@"<link\s*type=\x22(?'type'.*?)\x22\s*" +
@"href=\x22(?'href'.*?)\x22\s*" +
@"rel=\x22(?'rel'.*?)\x22\s*" +
@"\/>";
Regular Expression for `script` tag
@"(?ix)" +
@"<script\s*type=\x22(?'type'.*?)\x22\s*" +
@"src=\x22(?'src'.*?)\x22\s*" +
@"><\/script>";
Example
Supposing that you have your HTML in a variable of type string:
public const string LINK_PATTERN =
@"(?ix)" +
@"<link\s*type=\x22(?<type>.*?)\x22\s*" +
@"href=\x22(?<href>.*?)\x22\s*" +
@"rel=\x22(?<rel>.*?)\x22\s*" +
@"\/>";
public const string SCRIPT_PATTERN =
@"(?ix)" +
@"<script\s*type=\x22(?<type>.*?)\x22\s*" +
@"src=\x22(?<src>.*?)\x22\s*" +
@"><\/script>";
static void Main(string[] args)
{
string html = getBody();
Regex links = new Regex(LINK_PATTERN);
Regex scripts = new Regex(SCRIPT_PATTERN);
foreach (Match link in links.Matches(html))
{
Console.WriteLine("<link>: " + link);
Console.WriteLine("\ttype: " + link.Groups["type"]);
Console.WriteLine("\thref: " + link.Groups["href"]);
Console.WriteLine("\trel: " + link.Groups["rel"]);
Console.WriteLine("");
}
foreach (Match script in scripts.Matches(html))
{
Console.WriteLine("<script>: " + script);
Console.WriteLine("\ttype: " + script.Groups["type"]);
Console.WriteLine("\tsrc: " + script.Groups["src"]);
Console.WriteLine("");
}
Console.ReadKey();
}
public static string getBody()
{
string html = "";
html += "<html>";
html += "<head>";
html += "<link type=\"text/css\" href=\"c1.css\" rel=\"stylesheet\" />";
html += "<link type=\"text/css\" href=\"c2.css\" rel=\"stylesheet\" />";
html += "<link type=\"text/css\" href=\"c3.css\" rel=\"stylesheet\" />";
html += "<link type=\"text/css\" href=\"c4.css\" rel=\"stylesheet\" />";
html += "<link type=\"text/css\" href=\"c5.css\" rel=\"stylesheet\" />";
html += "<script type=\"text/javascript\" src=\"j1.js\"></script>";
html += "<script type=\"text/javascript\" src=\"j2.js\"></script>";
html += "<body>";
html += "<script type=\"text/javascript\" src=\"j3.js\"></script>";
html += "<script type=\"text/javascript\" src=\"j4.js\"></script>";
html += "</body>";
html += "</html>";
return html;
}