Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Arbitrary number of captures in a regular expression

by TimToady (Parson)
on Sep 26, 2007 at 00:27 UTC ( [id://641068]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Arbitrary number of captures in a regular expression
in thread Arbitrary number of captures in a regular expression

At what cost tho? Maintaining that array and rolling it back during backtracking must impose a runtime cost for what IMO is not all that common a use case.
Er, you're falling into Perl-5-Think here. The very fact that I used parens means that I do want to capture the array. If I didn't, I'd have used square brackets for the groupings I didn't want to capture. In Perl 6 we made it just as easy to not capture as it is to capture, so there's no need to guess about use cases in advance. You just write it how you want it.
  • Comment on Re^3: Arbitrary number of captures in a regular expression

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2024-04-19 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found