fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string input = "first page" + Environment.NewLine +
  8. "second line" + Environment.NewLine +
  9. "search string" + Environment.NewLine +
  10. "end of page one\f" +
  11. "second page" + Environment.NewLine +
  12. "second line" + Environment.NewLine +
  13. "search string" + Environment.NewLine +
  14. "end of page two\f";
  15. string pattern = @"(.*?)\f";
  16. Match match = Regex.Match(input, pattern,RegexOptions.Singleline);
  17.  
  18.  
  19. if (match != null)
  20. {
  21. Console.WriteLine(match.Value);
  22. }
  23. else
  24. Console.WriteLine("noot found");
  25. }
  26. }
Success #stdin #stdout 0.1s 24608KB
stdin
Standard input is empty
stdout
first page
second line
search string
end of page one