fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9.  
  10. String s = @"
  11. Console.WriteLine(""FOUND line without""); // anything.
  12. Console.WriteLine(""FOUND line without""); // ALLOWEDTAG
  13. Console.WriteLine(""FOUND line without""); // something else.
  14. Console.WriteLine(""FOUND line without""); // ALLOWEDTAG
  15. ";
  16.  
  17. foreach (Match m in Regex.Matches(s, @"(?m)^(?!.*ALLOWEDTAG).*WriteLine.*$"))
  18. Console.WriteLine(m.Value);
  19.  
  20.  
  21. }
  22. }
Success #stdin #stdout 0.08s 24536KB
stdin
Standard input is empty
stdout
Console.WriteLine("FOUND line without"); // anything.
Console.WriteLine("FOUND line without"); // something else.