fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace RegExApplication
  5. {
  6. public class Program
  7. {
  8. public static void Main(string[] args)
  9. {
  10. string myVar = "00000";
  11. string myPtrn = "(.).(...)";
  12. string mySub = "${1}" + "1" + "$2";
  13. string myResult = Regex.Replace(myVar, myPtrn, mySub);
  14. Console.WriteLine("Before :\t" + myVar + "\nAfter :\t" + myResult);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.13s 24552KB
stdin
Standard input is empty
stdout
Before :	00000
After :	01000