in reply to pattern matching with brackets

Depends on how easy "easy" is for you! You may have a look at Text::Balanced or Parse::RecDescent. You may also be interested in Regex Arcana.