rbala has asked for the wisdom of the Perl Monks concerning the following question:
This does not match 'aa'. It matched only 'a'. When i replaced with \1 , i got the output .$str = aa; $str =~ /(a)$1/; print "$&";
Can anyone explain this behaviour ?$str = aa; $str =~ /(a)\1/; print "$&";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Difference between $1 and \1.
by 7stud (Deacon) on Dec 27, 2012 at 10:50 UTC | |
by lidden (Curate) on Dec 31, 2012 at 23:05 UTC | |
|
Re: Difference between $1 and \1.
by LanX (Saint) on Dec 27, 2012 at 11:38 UTC | |
|
Re: Difference between $1 and \1.
by 2teez (Vicar) on Dec 27, 2012 at 12:04 UTC | |
by LanX (Saint) on Dec 27, 2012 at 12:20 UTC | |
by rbala (Acolyte) on Dec 27, 2012 at 14:08 UTC | |
by Anonymous Monk on Dec 27, 2012 at 14:11 UTC | |
|
Re: Difference between $1 and \1.
by Anonymous Monk on Dec 27, 2012 at 10:19 UTC |