PREG_MATCH check all words and condition
问题 I've written a regular expression which seraches the search terms in OR condition, such that provided three words have in string irrespective of their order. Now i want to just put an AND condition as I want to get ALL THREE words simulatniously in a string with different order. Here's my preg_match() regular expresison. $myPregMatch = (preg_match("/\b^(Word1|Word2|Word3)\b/", "Word4 Word2 Word1 Word3 Word5 Word7")); if ($myPregMatch){ echo "FOUND !!!"; } I want to find in string "Word4 Word2