fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Regex forwardSlashesRegEx = new Regex("\\(\"[^/\"]*/[^\"]*\"\\)");
  9. string[] strings = {
  10. "TEST:\"blah\"",
  11. "TEST:(\"blah\")",
  12. "TEST:\"blah//blah too\"",
  13. "TEST:(blah)",
  14. "TEST:\"blah/blah too\"",
  15. "TEST:(\"blah//BLAH too\")",
  16. "TEST:(\"Blah/blah too\")",
  17. "TEST:(\"//blah/blah-Another blah\")",
  18. "TEST:(\"blah blah blah-anotherblah//\")"
  19. };
  20. foreach (String s in strings)
  21. {
  22. if(forwardSlashesRegEx.IsMatch(s)){
  23. Console.WriteLine("Match --> " + s);
  24. }
  25. }
  26. }
  27. }
  28.  
Success #stdin #stdout 0.06s 26804KB
stdin
Standard input is empty
stdout
Match --> TEST:("blah//BLAH too")
Match --> TEST:("Blah/blah too")
Match --> TEST:("//blah/blah-Another blah")
Match --> TEST:("blah blah blah-anotherblah//")