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 = @"SMOOSH ""A"" AN ""B"" AN ""C"" AN ""D""";
  11.  
  12. Regex rgx = new Regex(@"(?:(?:\s+)?(?<smoosh>SMOOSH)\s+|(?<!^)\G) *(?:AN)* *""?([^""]*)""?");
  13.  
  14. foreach (Match m in rgx.Matches(input))
  15. Console.WriteLine(m.Groups[1].Value);
  16.  
  17. }
  18. }
Success #stdin #stdout 0.07s 34848KB
stdin
Standard input is empty
stdout
A
B
C
D