fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9.  
  10. String input = @"<html>
  11. ...
  12. <span id=""MyId"">string 1,string 2,string 3</span>
  13. ...
  14. </html>";
  15.  
  16. Regex rgx = new Regex(@"(?:<span id=""MyId"">|\G),?([^<>,]+)");
  17.  
  18. foreach (Match m in rgx.Matches(input))
  19. Console.WriteLine(m.Groups[1].Value);
  20.  
  21. }
  22. }
Success #stdin #stdout 0.07s 34144KB
stdin
Standard input is empty
stdout
string 1
string 2
string 3