If you particularly want a single regular expression, you can get it by using lookahead:
my $re = join ' ', map "(?= .*? \Q$_\E)", @ARGV; if ($entry =~ /^ $re/sx) { ... }
That would turn your example arguments into something like:
so it matches if:m{ ^ (?= .*? bill ) (?= .*? clinton ) }xs
from the start fail unless we can find some characters followed by "bill" _and_ (still from the start) fail unless we can find some characters followed by "clinton" succeed
I'm not sure how efficient that is, but it should be ok; if speed is important it would be worth benchmarking against some alternatives. Don't forget that when looking for an exact string match, index() can be faster than m/\Q$str\E/, and that if you're going to match one string against many regexps study($string) can help.
HugoIn reply to Re: regexp match arg1 AND arg2
by hv
in thread regexp match arg1 AND arg2
by Jaap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |