Help for this page

Select Code to Download


  1. or download this
    $ perl -Mre=debug -le " q/a a/ =~ /(.\b)\1/ "
    Compiling REx "(.\b)\1"
    ...
                                      failed...
    Match failed
    Freeing REx: "(.\b)\1"
    
  2. or download this
    $ perl -Mre=debug -le " q/aa/ =~ /a\b/ "
    Compiling REx "a\b"
    Final program:
    ...
       2 <aa> <>                 |  4:END(0)
    Match successful!
    Freeing REx: "a\b"
    
  3. or download this
         $x = "Housecat catenates house and cat";
        $x =~ /\bcat/; # matches cat in 'catenates'
        $x =~ /cat\b/; # matches cat in 'housecat'
        $x =~ /\bcat\b/; # matches 'cat' at end of string