Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @strings = ('', '1', 'a', "a\n");
    /^[a]*$/ && print "/^[a]*\$/ matches >$_<\n" for @strings;
    /^a*$/ && print "/^a*\$/ matches >$_<\n" for @strings;
    
  2. or download this
    /^[a]*$/ matches ><
    /^[a]*$/ matches >a<
    ...
    /^a*$/ matches >a<
    /^a*$/ matches >a
    <