fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string myString = "words words words FIRSTPHRASE these words I want SECONDPHRASE but not these words";
  9. string theWordsIWant = Regex.Replace(myString, @"^.*?FIRSTPHRASE\s*(.*?)\s*SECONDPHRASE.*$", "$1");
  10. Console.WriteLine(theWordsIWant);
  11. }
  12. }
Success #stdin #stdout 0.07s 33968KB
stdin
Standard input is empty
stdout
these words I want