Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Trying to count the captures in a compiled regular expression

by BooK (Curate)
on May 03, 2004 at 06:48 UTC ( #349937=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $regex = qr/foo/; # should return 0
    
  2. or download this
    sub captures {
        my $re = shift;
        return scalar ( @_ = '' =~ /(?:($re))?/ ) - 1;
    }
    
  3. or download this
     
    $regex = qr/(?x)  # (comment)
                (?-x) # (capture) (?x) # (comment)/;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://349937]
help
Chatterbox?
[prospect]: Learning Perl There where 17 videos.
[prospect]: And it was great because I'm using the book as well, to get some more examples or extra information
[ambrus]: Ask merlyn directly. Maybe he has copies.
[ambrus]: write him an email or something
[prospect]: ok I will

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-09-25 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (279 votes). Check out past polls.

    Notices?