my $regex = qr/a|b|c/; my $string = 'xxbxx'; if ( $string =~ /$regex/ ) { say 'TRUE' } else { say 'FALSE' }; #:TRUE