laziness, impatience, and hubris | |
PerlMonks |
Re: getting a return code from a looping regular expressionby splinky (Hermit) |
on Aug 01, 2000 at 23:43 UTC ( [id://25560]=note: print w/replies, xml ) | Need Help?? |
Utilizing Perl 5.6 regex features, you can do the following:
Which prints:
Specifically, -1 indicates that, at some point, an attempt was made to close parens that hadn't been opened. A positive number indicates how many unclosed left parens were encountered. Thanks, Ilya.
In Section
Seekers of Perl Wisdom
|
|