"abc_d1.txt" should get 0
"abc_d1_2.txt" should get 2
"abc_d1_14.txt" should get 14
"abc_d12_x2_156.txt" should get 156
这是我目前所做的,但我没有得到正确的结果。
string y = "tester_yg1.txt";
string pattern = @"(\d+)(?!.*\d)";
Regex rg = new Regex(pattern);
var z = rg.Match(fullFileName).Value;
Console.WriteLine($"z is {z}");