Can I use Perl regular expressions to match balanced text?
This is the official FAQ answer minus any subsequent edits. Your first try should probably be the Text::Balanced module, which is in the Perl standard library since Perl 5.8. It has a variety of functions to deal with tricky text. The Regexp::Common module can also help by providing canned patterns you can use. As of … Read more