Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by GrandFather (Sage)
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

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 grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-11-20 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (284 votes). Check out past polls.

    Notices?