pysome has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
pls help me check this issues: E.g:
But on the contrary,I wanna get a "left-to-right" substitution.That is ,i want to get "12-34-56-78-9"
I try :
Pysome
pls help me check this issues: E.g:
It produce "1-23-45-67-89" ,it is OK.$d = "123456789"; $d =~ s/(?<=\d)(?=(\d\d)+$)/-/g; print "$d";
But on the contrary,I wanna get a "left-to-right" substitution.That is ,i want to get "12-34-56-78-9"
I try :
It can't work.Where does it wrong? The wrong log:$d =~ s/(?<=^(\d\d)+)(?=\d)/-/g;
TIA.Variable length lookbehind not implemented in regex; marked by <-- HER +E in m/(?<=^(\d\d)+)(?=\d) <-- HERE / at Noname1.pl line 4.
Pysome
Back to
Seekers of Perl Wisdom