in reply to pattern matching with brackets

The "easy" way is to use: Regexp::Common::balanced have a look at "perldoc -q nesting" as well for more information on this FAQ

-enlil