fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. foreach (string s in new[] {@"d:\tmp\abc_list.csv", @"d:\tmp\xyzx_list.csv", @"d:\tmp\qwert_list.csv"}) {
  9. var res = Regex.Matches(s, @"(?<=\\)[^_\\]*(?=_[^\\]*$)")[0].Value;
  10. Console.WriteLine(res);
  11. }
  12.  
  13. }
  14. }
Success #stdin #stdout 0.06s 34136KB
stdin
Standard input is empty
stdout
abc
xyzx
qwert