gingaloon has asked for the wisdom of the Perl Monks concerning the following question:
I get:my $x=12345; $x=~s/(?<=\d{2})/\012/g; print $x,"\n";
12 3 4 5I know I can do this other ways, but the result has left me confused as to what is going on with the look behind with the global modifier. Surely at position 3 the look behind 'sees' 12\n? No? Any explanation would be appreciated many thanks james
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Look behind and global
by hv (Prior) on Mar 14, 2005 at 11:55 UTC | |
Re: Look behind and global
by maa (Pilgrim) on Mar 14, 2005 at 11:51 UTC | |
Re: Look behind and global
by thinker (Parson) on Mar 14, 2005 at 12:03 UTC | |
Re: Look behind and global
by Tanktalus (Canon) on Mar 14, 2005 at 15:31 UTC |