in reply to Re: Bizarreness in ?PATTERN? and g
in thread Bizarreness in ?PATTERN? and g

Try printing the value of $_ before each regex and you will see that you try to match 1 and 2 in your first example as the for-loop automagically loads $_ with the "loop index".

As an aside, your first example prints nothing as the regex never matches!

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law