fork download
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4.  
  5. partial void Main()
  6. {
  7. var line = "Keeping the line intact, replace me, but not you, keep this too.\n\nRetaining me, replace one, but not two, ignore three.";
  8. var res = Regex.Replace(line, @"replace (?<target>.*), but not (?<source>.*),",
  9. m => "replace " + m.Groups["source"].Value.Replace("o", "1") + ", but not " + m.Groups["source"].Value + ",");
  10. Console.WriteLine(res);
  11. }
Compilation error #stdin compilation error #stdout 0.08s 29356KB
stdin
Standard input is empty
compilation info
prog.cs(5,8): error CS1525: Unexpected symbol `void', expecting `class', `interface', `ref', or `struct'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty