- or download this
$ perl -Mre=debug -le " q/a a/ =~ /(.\b)\1/ "
Compiling REx "(.\b)\1"
...
failed...
Match failed
Freeing REx: "(.\b)\1"
- 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"
- 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