my @regexes = ('([\d\w]+)', 'another Regex'); my $regex = join('|',@regexes); if($string =~ /($regex)/){ print $1; }