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