fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"X([^X]+)";
  9. string input = @"X
  10. aaaa
  11. X
  12. bbbb
  13. X
  14. cccc";
  15.  
  16. foreach (Match m in Regex.Matches(input, pattern))
  17. {
  18. Console.WriteLine(m.Groups[1].Value.Trim());
  19. }
  20. }
  21. }
  22.  
Success #stdin #stdout 0.06s 27252KB
stdin
Standard input is empty
stdout
aaaa
bbbb
cccc