The other answers are perfectly fine for your specific problem, but as Paulpro noted really get out of hand when you have more than two words.
The easiest way out is to use multiple checks as Explosion Pills suggests.
But for a more scalable regex-only approach you can use lookaheads:
/^(?=.*google)(?=.*microsoft)(?=.*apple).../
The lookahead doesn't actually consume anything, so after the first condition is checked (that .*google
can match), you are back at the beginning of the string and can check the next condition. The pattern only passes if all lookaheads do.
Note that if your input may contain line breaks, .*
will not do. You'll have to use [^]*
or [\s\S]*
instead (same goes for the others' answers).