use strict; my $nest; for (<DATA>) { $nest++ if /\bloop/; $nest-- if /\bendloop/; $nest && /warn/ && print } __DATA__ begin loop warn('xxx'); endloop; loop null; loop warn('AAA'); endloop; endloop; loop loop warn('BBB'); endloop; warn('rrr'); endloop; begin loop endloop; warn('yyy'); end; warn('zzz'); end;
In reply to Re: more regex help ...
by Roger
in thread more regex help ...
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |