# Validate these subexpressions before putting in main regex. my $pre_re = qr{blah}; my $body_re = qr{foobar}; my $post_re = qr{bizbaz}; while ($data =~ /$pre_re($body_re)$post_re/) { #### my @array = qw(foo bar biz); # Want to match any in the list; my $list = join '|', map {quotemeta} @array; while ($data =~ /($list)/) {