Languages that support lookaheads (Javascript, PCRE, Ruby, Java, Python) can use them to test whether the line/string contains these values, in any order:
^(?=.*\b(item1)\b)(?=.*\b(item2)\b)(?=.*\b(item3)\b)
For your [1.] data, this becomes:
^(?=.*\b(apple)\b)(?=.*\b(orange)\b)(?=.*\b(plum)\b)
You can see this on regex101 here.
For your [2.] data, this becomes:
^(?=.*\b(apple)\b)(?=.*\b(grape)\b)(?=.*\b(plum)\b)
You can see this on regex101 here.
You, of course, don't need to have the capture groups INSIDE of the lookaheads. You could simply match those items (without capture groups) and then use .*
at the end of the pattern to match from the start of the line to the end:
^(?=.*\bapple\b)(?=.*\borange\b)(?=.*\bplum\b).*
Notice on regex101 however that you no longer see results under MATCH INFORMATION (nothing was captured), but the entire line WAS selected as the match was valid.