My requirement is, I want to match words in a sentence from two groups of words, say the sentence should contain at least one word from group 1 and at least 1 from group 2 as well.
Expression - (football | hockey | cricket) and (ronaldo | messi | kohli | jordan)
The sentence can be -
Ronaldo is the highest paid player in Football.
What could be the possible regex for this, language is php.
I tried
(?=.*\b(cat|dog|rat)\b)(?=.*\b(blue|black|red)\b).*$
It works but is case sensitive.