http://www.perlmonks.org?node_id=529524


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