Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by demerphq (Chancellor)
on Sep 25, 2007 at 23:24 UTC ( #641062=note: print w/replies, xml ) Need Help??


in reply to Re: 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.

---
$world=~s/war/peace/g

  • Comment on Re^2: Arbitrary number of captures in a regular expression

Replies are listed 'Best First'.
Re^3: Arbitrary number of captures in a regular expression
by TimToady (Parson) on Sep 26, 2007 at 00:27 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://641062]
help
Chatterbox?
[erix]: bullfinch ( a male and a female )
erix learned the word 'portaging' not so long ago (from vikings lugging their ships from one river-system to another)
[choroba]: my best run so far
[erix]: I think they build a portaging installation for yachts here not so long ago - lemme google it
[erix]: choroba ah, you should have sprinted 7 s off that :)
[erix]: (but then there's always a next (im)possible goal)
Corion avoids running by starting on time
[choroba]: my phone showed me 1 hour 10 km which was my goal, it changed a bit after uploading to the website

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-05-24 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?