Help for this page

Select Code to Download


  1. or download this
    my $rx = 'abc';
    my $qr = qr/$rx/;
    ...
    else {
        print "ABC does not match /abc/i\n"
    }
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    "the alphabet ends with XYZ" =~ /xyz/i => (pattern) match
    dot-matches-all (qr) does not match
    dot-matches-all (literal) matches
    
  3. or download this
    $ perl -e 'for (qw( i x s m )) {print eval "qr/perl/$_", "\n"}'
    (?i-xsm:perl)
    (?x-ism:perl)
    (?s-xim:perl)
    (?m-xis:perl)