How to match multiple words in regex
Just a simple regex I don't know how to write. The regex has to make sure a string matches all 3 words. I see how to make it match any of the 3: /advancedbrain|com_ixxocart|p\=completed/ but I need to make sure that all 3 words are present in the string. Here are the words advancebrain com_ixxocart p=completed Use lookahead assertions : ^(?=.*advancebrain)(?=.*com_ixxochart)(?=.*p=completed) will match if all three terms are present. You might want to add \b work boundaries around your search terms to ensure that they are matched as complete words and not substrings of other words (like