Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Tristan Miller
February 8, 2005, 12:45 pm
rate this thread
Does Perl offer any support for search-and-replace with parenthesis
balancing and escape characters? I know it's not possible to do with
standard regexps, but I thought perhaps there might be some built-in
functions that would save me the trouble of writing my own routine which
simulates a stack.
For example, I want to change foo(...) to <bar>...</bar> with escape
character \, so that
foo( baz( ... ) ... )
<bar> baz( ... ) ... </bar>
Anyone have a snippet for this?
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\ http://www.nothingisreal.com/ < To finish what you