fork download
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "AB12 (1,2,3 words, 4,5,6,7,8,9)";
  10. var pat = @"(?<=^[A-Z]{2}\d{2}\s+\([^()]*)\s*[^,\d]+(?=[^()]*\))";
  11. var res = Regex.Replace(str, pat, string.Empty);
  12. Console.WriteLine(res);
  13. }
  14. }
Success #stdin #stdout 0.13s 24704KB
stdin
Standard input is empty
stdout
AB12 (1,2,3,4,5,6,7,8,9)