fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text.RegularExpressions;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var str = "<!text 1 here!!> <!text 2 here!!>";
  11. var matches = Regex.Matches(str, @"<!(.*?)!>")
  12. .Cast<Match>()
  13. .Select(s => s.Groups[1].Value)
  14. .ToList();
  15. foreach (var m in matches)
  16. Console.WriteLine(m);
  17. }
  18. }
Success #stdin #stdout 0.03s 30392KB
stdin
Standard input is empty
stdout
text 1 here!
text 2 here!