fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. Console.WriteLine( string.Join("\n",
  10. Regex.Matches("Extract all words but word1 and word2.", @"\b(?!(?:word1|word2)\b)\w+")
  11. .Cast<Match>().Select(x=>x.Value))
  12. );
  13. }
  14. }
Success #stdin #stdout 0.06s 21860KB
stdin
Standard input is empty
stdout
Extract
all
words
but
and