fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var s = "[12345]";
  8. var result = Regex.Replace(s, @"(\[\d+\])", @"$1".Insert(1, "0"));
  9.  
  10. Match match = Regex.Match(s, @"(\[\d+\])");
  11. if (match.Success) {
  12. var test = match.Value.Insert(1, "#");
  13. Console.WriteLine(test);
  14. }
  15. }
  16. }
Success #stdin #stdout 0.07s 31256KB
stdin
Standard input is empty
stdout
[#12345]