if ( $string =~ /re1/ ) { #do thing 1 } elsif ( $string =~ /re2/ ) { #do thing 2 } elsif ( $string =~ /re3/ ) { #do thing 3 }