fork(1) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "Test123(45) and More (5 numbers inside parentheses 123)";
  10. var result = Regex.Replace(str, @"\([^()]+\)", m => Regex.Replace(m.Value, @"\d+", string.Empty));
  11. Console.WriteLine(result);
  12. }
  13. }
Success #stdin #stdout 0.11s 24672KB
stdin
Standard input is empty
stdout
Test123() and More ( numbers inside parentheses )