Help for this page

Select Code to Download


  1. or download this
    my @strings = qw(ABC DEF GHI JKL);
    my $regex = join '|', map "\Q$_\E", @strings;
    ...
        print " Match\n";
      }
    }
    
  2. or download this
    my @strings = qw(ABC DEF GHI JKL);
    my $regex = lc join '|', map "\Q$_\E", @strings;
    ...
        print " Match\n";
      }
    }
    
  3. or download this
    $ perl -Mre=debug -e'qr/foo|bar|baz|boo/'
    Compiling REx "foo|bar|baz|boo"
    ...
      13: END (0)
    minlen 3
    Freeing REx: "foo|bar|baz|boo"