in reply to Re: pattern matching nested { }'s
in thread pattern matching nested { }'s

Thanks for your reply. I think I was a little unclear in my original post. Only the { } immediately after onValidate should match. For example:
onValidate { stuff in here { other stuff } }
should all be removed and
keep this { remove this {and {this}} }
should all be kept.

Thanks, Gerard.

Replies are listed 'Best First'.
Re: Re: Re: pattern matching nested { }'s
by Caron (Friar) on Mar 02, 2004 at 10:34 UTC

    Well, in that case, just say it to your replacement command:

    $text =~ s/(onValidate)\s*$re/$1/g; # or even $text =~ s/(?<=onValidate)\s*$re//g; print $text;

    It gives:

       onValidate
       keep this
       {
           remove this {and {this}}
       }