fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. string pattern = @"(?:\[|\G(?!^))('[^']+'),?(?=[^\]]*\])";
  10. string input = @"cov('Age', ['5','7','9'])";
  11.  
  12. var results = Regex.Matches(input, pattern)
  13. .Cast<Match>()
  14. .Select(m => m.Groups[1].Value)
  15. .ToArray();
  16.  
  17. foreach(string result in results)
  18. {
  19. Console.WriteLine(result);
  20. }
  21. }
  22. }
Success #stdin #stdout 0.06s 22160KB
stdin
Standard input is empty
stdout
'5'
'7'
'9'