$value1="a1 a2 a3 a4"; $value2=$value1; while($value1=~/a(\d)/g){ print $1; last; } while($value2=~/a(\d)/g){ print $1; }
does indeed output 11234 so it has everything to do with the fact that it is not the regex, but rather the variable your are trying to match is the same or not.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In reply to Re: Bizarreness in ?PATTERN? and g
by CountZero
in thread Bizarreness in ?PATTERN? and g
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |