Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: mysteries of regex substring matching

by haukex (Archbishop)
on Jan 15, 2021 at 22:50 UTC ( [id://11126981]=note: print w/replies, xml ) Need Help??


in reply to mysteries of regex substring matching

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11126981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 06:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found