fork(3) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string myString = "<tr class=\"discussion r0\"><td class=\"topic starter\"><a href=\"SITE?d=6638\">Test di matematica</a></td>";
  9. Regex rx = new Regex(@"<a.*?>(.*?)</a>");
  10. MatchCollection matches = rx.Matches(myString);
  11. if (matches.Count > 0)
  12. {
  13. Match match = matches[0]; // only one match in this case
  14. GroupCollection groupCollection = match.Groups;
  15. Console.WriteLine( groupCollection[1].ToString());
  16. }
  17. }
  18. }
Success #stdin #stdout 0.07s 34160KB
stdin
Standard input is empty
stdout
serial Test di matematica