in reply to Re^2: regexp match repetition breaks in Perl
in thread regexp match repetition breaks in Perl

So, I need to reset the pos before each pass. 3-digit APC codes are just one of the passes.

Not quite.

$_ = 'a1!b2.c3?'; print $1 while /([abc])/g; # abc print $1 while /([123])/g; # 123 print $1 while /([!.?])/g; # !.? print "\n";

Note the lack of the c modifier. That does exactly the opposite of what you want. It's purpose is to prevent pos from getting reset.