/g tells the regex engine to find all the matching sequences in the target string it can. In list context anything captured during the process is returned in a list. But there is some subtle stuff going on in your sample.
When a match is zero width (like /()/g) an unterminated loop can be generated. The regex engine choses a "second best match" one character further along to avoid the problem. That situation applies in your sample code where the (?=...) is a zero width assertion (it just shoves a stake in the ground and says "match from here"). Because there are capture brackets inside the assertion expression ((\d\d\d)) three digits are captured. Because the assertion is zero width the regex engine moves the capture point along one character for each iteration.
In reply to Re: Explanation for Reg Expr
by GrandFather
in thread Explanation for Reg Expr
by decoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |