You may also wish to look into Text::Balanced. extract_bracketed looks like it would do the trick for you.
TGI says moo
In reply to Re: Matching a pattern which resides within round brackets
by TGI
in thread Matching a pattern which resides within round brackets
by jbl_bomin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |