Gerard has asked for the wisdom of the Perl Monks concerning the following question:
What I have come up with,onValidate { stuff in here }
Should match ok, but it is possible that the section could look like$text=~s/onValidate\s{(.*?)}//g;
How would I go about matching to the last } ? Given that there are also plenty of other { } in the file which I do not want to match. Also, will this replace multiple times in the file, provided I read the whole file into $text?onValidate { stuff in here { other stuff } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching nested { }'s
by Caron (Friar) on Mar 02, 2004 at 10:06 UTC | |
by Gerard (Pilgrim) on Mar 02, 2004 at 10:28 UTC | |
by Caron (Friar) on Mar 02, 2004 at 10:34 UTC | |
|
Re: pattern matching nested { }'s
by diotalevi (Canon) on Mar 02, 2004 at 14:29 UTC | |
|
Re: pattern matching nested { }'s
by bart (Canon) on Mar 02, 2004 at 21:09 UTC |