fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var pattern = @"^(?:[^_]+_){2}(\d+)";
  9. var text = "XXXXX_20160207_20180208_XXXXXXX_20190408T160742_xxxxx";
  10. var result = Regex.Match(text, pattern)?.Groups[1].Value;
  11. Console.WriteLine(result);
  12. }
  13. }
Success #stdin #stdout 0.06s 21116KB
stdin
Standard input is empty
stdout
20180208