my @array = ("A", "B", "C"); my $reAsStr = join("|", @array); my $re = qr/$reAsStr/;