$outer = join "|", qw/ hi bye /; /($outer)/ and print $1 for qw/ bike hello-hi hi-ho /;