using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<=^[0-9]{14}_).+(?=_)";
string substitution = @"$0";
string input = @"20231025041306_LLLLL_Aaaaaaaaaa_7777d4cb-6666631f-fa38-473e-a650-d3564505a2075.xls
20231025041406_LLLLL_Aaaaaaaaaa_8777befd-87765c3e-3164-4800-b102-a82d48aaaa52.xlsx
20231025041436_LLLLL_Aaaaaaaaaa_73d2bbbc.PDF
20231025041518_LLLLL_Aaaaaaaaaa_210zzz2c.csv
20231025041613_LLLLL_Aaaaaaaaaa_aqqqq1ad.txt
20231025041906_cccc_dddddd_rrrrrr_a6fff0d3.xls
20231025041935_cccc_dddddd_rrrrrr_f37ggg89.pdf
20231025042000_cccc_dddddd_rrrrrr_9e812343.csv
20231025042026_cccc_dddddd_rrrrrr_d7522280.txt
20231025042229_LllllAaaaaaaa_OO_OoooTttt_37gggd7-5e81ffhgedc77-4c8e-9fbc-d2996ggg0df1.xls
20231025042254_LllllAaaaaaaa_OO_OoooTttt_4fjjjfrgb-e3ec7993-92d7-4ab8-ad9e-83ejjjjj929b.xlsx
20231025042329_LllllAaaaaaaa_OO_OoooTttt_c0fkkkkf2.pdf
20231025042410_LllllAaaaaaaa_OO_OoooTttt_b555tefd7f.csv
20231025042505_LllllAaaaaaaa_OO_OoooTttt_9784g07e.txt
20231025042747_Ppppp_Rrrrr_Rrrrrr_2902e487-cc3c6chhhh074-4a2e-a97f-bfa0000a062e.xls
20231025042813_Ppppp_Rrrrr_Rrrrrr_aab84122-2fzzzz68-a706-49a5-a3ef-40030ffff0a3.xlsx
20231025042842_Ppppp_Rrrrr_Rrrrrr_79cdgggd2.PDF
20231025042923_Ppppp_Rrrrr_Rrrrrr_f07yyya8f.csv
20231025043220_Tttt_Dddddd_Rrrrrr_2444gr18d-13b4fb14-8fc2-45e0-b18b-59jkh6353d78.xlsx
";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx