fork(9) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var s = "abcde\n fghij<FooBar>";
  12. var rx = @"(.*)<FooBar>";
  13. var res1 = Regex.Match(s, rx, RegexOptions.Singleline);
  14. if (res1.Success) {
  15. Console.WriteLine(res1.Groups[1].Value);
  16. }
  17. rx = @"(.*)<FooBar>";
  18. var res2 = Regex.Match(s, rx, RegexOptions.Singleline);
  19. if (res2.Success) {
  20. Console.WriteLine(res2.Groups[1].Value);
  21. }
  22. }
  23. }
Success #stdin #stdout 0.03s 134720KB
stdin
Standard input is empty
stdout
abcde
		fghij
abcde
		fghij