in reply to Re^7: [bugs?] perldoc perlre, \G and pos()
in thread [bugs?] perldoc perlre, \G and pos()
DB<168> $str="abcd" DB<169> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<170> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 0:: DB<171> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<172> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<173> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<174> pos($str)=0 DB<175> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 0:: DB<176> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<177> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<178> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<179> pos($str)=undef DB<180> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<181> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1: DB<182> print pos($str),":",scalar ($str=~/(.)\G/g),":",$1 :1:
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: [bugs?] perldoc perlre, \G and pos()
by ikegami (Patriarch) on Sep 29, 2009 at 23:36 UTC |