Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: regex: finding something that doesn't contain a quotation?

by GrandFather (Cardinal)
on Feb 11, 2006 at 04:59 UTC ( #529524=note: print w/ replies, xml ) Need Help??


in reply to regex: finding something that doesn't contain a quotation?

Two tests:

use strict; use warnings; use Regexp::Common qw/balanced/; while (<DATA>) { chomp; next if ! /($RE{balanced}{-parens=>'()'})/ or $1 =~ /^\("/; print "$_\n"; } __DATA__ blah.boo(getSomething()) blah.boo("getSomething") blah.boo(getSomething("something else")) blah.boo("getSomething()")

Prints:

blah.boo(getSomething()) blah.boo(getSomething("something else"))

DWIM is Perl's answer to Gödel


Comment on Re: regex: finding something that doesn't contain a quotation?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-12-27 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls