Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 avoiding work at the Monastery: (9)
As of 2014-09-18 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (124 votes), past polls