RegEx: find words in random order

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Hello,

I've a little problem:

A RegEx should match, when 2 words are found in one text-line in
random order.

For a simplified example, it should return true, wenn the line
contains "color" and one of the words "blue" and "red": 
"bluecolor", "blue-color" or "red color", "color red"...

.(?=(blue|red))(?=color)
Amongst others I tried to solve this with look-around-assertions but
without success. (It's irrelevant whether the RegEx matches, when one
of the words is in the very beginning or the end of the line. They
only occur in the middle. There's no need to catch substrings.)

In this way it should work, but the I hope, that it can be simplified,
because in reality there are more and longer words.
.*((blue|red).*color)|(color.*(blue|red))

Does anybody have an idea?

-davidoff12001
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.