he only way to end the search is to use the ultimate closeing brace. Perhaps using increment and decrement on 1st open and last close braces?
You could use a recursive regex. Easiest way to get one is Regexp::Common.
use Regexp::Common; $_ = q{ public void readExternal() { this { is } not { { real } java } code but an { { { example } } } } }; my ($function) = /( public \s+ void \s+ readExternal [^{]+ $RE{balanced}{-parens=>' +{}'} )/x;
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
In reply to Re: Extract lines of .java
by Juerd
in thread Extract lines of .java
by knobbled
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |