Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-09-22 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls