fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var sampleText = @"Mr. Grant and Ms. Kelly starred in the film \'To Catch A Thief' but not in 'Stardust' because they'd stopped acting by then";
  9. var regEx = new Regex("(?<!\\\\)'");
  10. var result = regEx.Replace(sampleText, "\\'");
  11. Console.WriteLine(result);
  12. }
  13. }
Success #stdin #stdout 0.06s 38136KB
stdin
Standard input is empty
stdout
Mr. Grant and Ms. Kelly  starred in the film \'To Catch A Thief\' but not in \'Stardust\' because they\'d stopped acting by then