in reply to pattern matching words in any order
is probably the best. The alternative would be/this/ && /that/
/this.*that|that.*this/s
Using Perl features, you can also do
/^(?=.*this)(?=.*that)/s /^(?=.*this).*that/s
Keep in mind that these aren't all equivalent. Consider the string "thathis"
|
|---|