So, is there a way to use capture groups to match multiple times like separate groups does inthe first example?
Not really (Update: at least within a single regex, LanX already showed /g), unless you mess around with some of the more advanced regex features like maybe (?{})/(??{}). But before going down that route, this feels like an XY Problem to me; for example, for the task you show, unpack may be better, e.g. unpack("(A4)4A*","AAD34017837201D98AAED18778DEF993")
Minor edits.
In reply to Re: mysteries of regex substring matching
by haukex
in thread mysteries of regex substring matching
by smile4me
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |