fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string testStr = "|12||13||14|";
  8. var testMatch = Regex.Match(testStr, @"^(?:\|([0-9]+)\|)+$");
  9. int captureCtr = 0;
  10. foreach (Capture capture in testMatch.Groups[1].Captures) {
  11. Console.WriteLine("Capture {0}: {1}", captureCtr++, capture.Value);
  12. }
  13. }
  14. }
Success #stdin #stdout 0.08s 34160KB
stdin
Standard input is empty
stdout
Capture 0: 12
Capture 1: 13
Capture 2: 14