Hi, @vasile-caraus,
Now, I realized that the regex, given in my previous post, (?i-s)(Word1).*?(Word2)|(?2).*?(?1) could be simplified !
Indeed, as I explained, we can’t use back-references, which are not defined if the regex engine choose the second alternative ! But, when the boundaries Word1 and Word2 are not, themselves, regexes ( as, for instance \d+, a..z… ) and rather simple strings, we can use the more simple syntax below :
(?i-s)Word1.*?Word2|Word2.*?Word1
Secondly, to select any entire line ( with its EOL characters ) containing the two words Word1 and Word2, whatever their order, use the regex, below :
(?i-s)^.*(Word1.*Word2|Word2.*Word1).*\R
Best Regards,
guy038
P.S. :
As we’re rather dealing with exact words, we should use, instead of the two above, the regexes, below :
(?i-s)(?<=\W)Word1\W.*?\WWord2(?=\W)|(?<=\W)Word2\W.*?\WWord1(?=\W)
and
(?i-s)^.*\W(Word1\W.*\WWord2|Word2\W.*\WWord1)\W.*\R