I have a string like this.
var str = "[cat dog] [dog cow] [cow cat] [cat tiger] [tiger lion] [monkey dog]";
I want to match the pair of animals that doesn't contain a specific one. For example I want to select all pair of animals that doesn't contain dog. So the output should be
[cow cat]
[cat tiger]
[tiger lion]
Is it possible to match using Regular Expression using str.match()
method?