my $H = qr{abjdk|adfkj}; if ($thisstring =~ $H) { # do stuff }