fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string str = "Only 'together' can we turn him to the 'dark side' of the Force";
  9. string result = Regex.Replace(str, @"('[^']*\bdark\b[^']*')|'[^']*'", "$1");
  10. Console.WriteLine(result);
  11. Console.ReadLine();
  12. }
  13. }
Success #stdin #stdout 0.08s 24544KB
stdin
Standard input is empty
stdout
Only  can we turn him to the 'dark side' of the Force