Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Nesting regexen

by BrowserUk (Patriarch)
on Jul 11, 2005 at 08:32 UTC ( [id://473873]=note: print w/replies, xml ) Need Help??


in reply to Nesting regexen

In addition to Daedalus207' fix, you are also missing a close paren literal in your subroutine regex:

my $subroutine = qr/((\w+::)*\w+\($sub_args\))/; # ^

You might also want to add some optional whitespace at strategic points unless you are striping this first.

Your regex would be easier to read and maintain if you used /x.

my $subroutine = qr/ ( (\w+::)* \w+ \( $sub_args \) ) /x;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Nesting regexen
by colink (Novice) on Jul 11, 2005 at 18:29 UTC
    The code that I posted is hacked up as the result of about two hours of debugging. The original used /x and matched the closing paren.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-20 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found