The match operator with the /g option will match all the patterns if it is used in list context. However, when used in scalar context it iterates through each pattern in turn, which is what you are experiencing.
In reply to Re: regex only matching from last match
by jwkrahn
in thread regex only matching from last match
by Foxpond Hollow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |