fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var s = "GET_LIST 1000 10001 10002";
  12. var pattern = @"^GET_LIST(?:\s+([A-Za-z0-9]{4,10})){0,100}$";
  13. var results = Regex.Matches(s, pattern)
  14. .Cast<Match>().SelectMany(p => p.Groups[1].Captures
  15. .Cast<Capture>()
  16. .Select(t => t.Value)
  17. )
  18. .ToList();
  19. Console.WriteLine(string.Join(", ", results));
  20. }
  21. }
Success #stdin #stdout 0.08s 20436KB
stdin
Standard input is empty
stdout
1000, 10001, 10002