No such thing as a small change | |
PerlMonks |
Re: mysteries of regex substring matchingby haukex (Archbishop) |
on Jan 15, 2021 at 22:50 UTC ( [id://11126981]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|