in reply to Regex Find Words

Bound to miss something unspecified :)

#! perl -slw use strict; my $left_text = [ qw{ when rome romans} ]; my $right_text = 'When in Rome, do as the Romans.'; my $regex = '(?:\b' . join( '\b|\b', map quotemeta, @$left_text ) . '\ +b)'; print $regex; my $found = () = $right_text =~ m/$regex/ig; print $found ? 'matched: ' : 'Not matched', $found; __END__ C:\test>junk42 (?:\bwhen\b|\brome\b|\bromans\b) matched: 3

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy