Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
[1nickt]: herveus is so weird. Love his reply in that SQLite thread! Much more effective warning system to have diverse monks debunk on technical merits...
[haukex]: IPC::System:: Simple does all the $? handling for you, and does it well
[erix]: weird problem btw (that SQLite question) - I asked astroboy to let us know if he finds the cause
[hippo]: The syntax is warning enough to me.
[1nickt]: hippo lately I can tell just by the fact that Anonymous posts a reply after some hours that it is more than likely That Monk.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-12-13 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (360 votes). Check out past polls.

    Notices?