Then you need to have a QRegExp that contains the logical OR of both forms of your search phrase:

(word1 some word2) | (word2 some word1)