Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Is there another way to get named captures

by Corion (Patriarch)
on Jan 10, 2022 at 13:31 UTC ( #11140322=note: print w/replies, xml ) Need Help??


in reply to Re: Is there another way to get named captures
in thread Is there another way to get named captures

Thanks for writing this!

Personally, I think there could be a small enhancement, to be able to also create match objects without needing the regular expression, like:

my $string = 'foo foo fooo'; while( $string =~ /(fo+)/g) { my $match = Regex::Object->collect(); push @matches, $match; }

That way, the collecting of the match data is available even when I'm not running a plain match.

Replies are listed 'Best First'.
Re^3: Is there another way to get named captures
by AlexP (Monk) on Jan 11, 2022 at 12:47 UTC
Re^3: Is there another way to get named captures
by AlexP (Monk) on Jan 10, 2022 at 19:12 UTC

    Great idea! I'll think about implementation!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-05-17 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (68 votes). Check out past polls.

    Notices?