fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var str="15-16-00-014716 AND15- [ ] (5) Description of 16-00-014715";
  12. var a= Regex.Replace(str, @"\s+\[.*?(?=\b\d+(?:-|$))", "");
  13. Console.WriteLine(a);
  14.  
  15. var str1="15-16-00-014716 AND15- [ ] (5) Description of 1600014715";
  16. var a1= Regex.Replace(str1, @"\s+\[.*?(?=\b\d+(?:-|$))", "");
  17. Console.WriteLine(a1);
  18. }
  19. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
15-16-00-014716 AND15-16-00-014715
15-16-00-014716 AND15-1600014715