Questo esempio funziona, probabilmente però bisognerà tarare meglio la regular expression:
codice:string input = "[*]<a href=\"http://foo/link1.html\" rel=\"1234\" class=\"preview\"> Linkname 1 </a>" + "[*]<a href=\"http://foo/link2.html\" class=\"preview\"> Linkname 2 </a>" + "[*]<a href=\"http://foo/link3.html\" rel=\"1234\"> Linkname 3 </a>"; Regex rx = new Regex("[*]<a href=\"(?<href>[\\w:/\\.]+)\"( rel=\"([\\w]+)\")?( class=\"([\\w]+)\")?>(?<title>[\\w ]+)</a>"); MatchCollection matches = rx.Matches(input); foreach (Match match in matches) { Console.WriteLine("href: {0} --- title: {1}", match.Groups["href"].Value, match.Groups["title"].Value); }

Rispondi quotando