Help for this page

Select Code to Download


  1. or download this
    $text = 'I like donkeys';
    if ($text =~ /a*((ab)*|b*)/) {    print "Success ($1)\n";  }
    
  2. or download this
     $text =~ / a*    # zero or more of 'a'
                      (     # followed by
                     (ab)*  # zero or more of 'ab'
                      |     # or
                      b*    # zero or more of 'b'
                     )/x