in reply to getting a return code from a looping regular expression
should work.@foo = ('a(b(c)d(e(f)g)h)i(j(k)l(m)n)o', 'a(b(c)d(e(f)g)h)i(j(k)l(m)n)o'); for (@foo) { print "\'$_\' has "; while s/[(][^()][)]//; # get rid of matched () print "un" if /[()]/; # see if any unmatched print "balanced parentheses" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: getting a return code from a looping regular expression
by DrManhattan (Chaplain) on Aug 01, 2000 at 19:32 UTC | |
by BlaisePascal (Monk) on Aug 01, 2000 at 22:57 UTC | |
|
RE: Re: getting a return code from a looping regular expression
by maverick (Curate) on Aug 01, 2000 at 19:30 UTC |