I have these strings in an array and I want to iterate this array and find those who match (one line per match check).
The thing is, I can't find the right regex.
Bird
Cat
Dog
Fish
CatDog
DogCat
Currently, with RegexBuddy (damn nice software!!), I have this regex:
(?!Cat\b)\b\w+
I want to add the "Dog" to it so in one regex match try I'll get a match result, you know, like an OR operator.
I want it to check if "Cat" or "Dog" or "Fish" is there in one go.
Any idea?
.contains(),.equals()or the like on a collectioncontains()andequals()will probably result in more readable code but I would expect regex to be more efficient for this.