Help for this page

Select Code to Download


  1. or download this
    # @a holds a list of string
    my @a = ("a", "b", "c", "/", "\[", "\"");
    ...
    #create a regex that matches every element in the array
    my $re = do { qr/(@{[join ("|", map { quotemeta } @a)]})/ };
    die "not a regex!" unless ref($re) eq "Regexp";
    
  2. or download this
    #you don't need to escape ;
    ... $chosen_C !=~ /^\*.{36};$re;/ ...
    
  3. or download this
    my $re = do { qr/^\*.{36};(@{[join ("|", map { quotemeta } @a)]});/ };
    die "not a regex!" unless ref($re) eq "Regexp";
    
    ... $chosen_C !=~ $re ...