I have an expression which I need to split and store in an array:
aaa=\"bbb{ccc}ffffd\" { aa=\"bb,cc\" { a=\"b\", c=\"d\" } }, aaa=\"bbb{}\" { aa=\"b}b\" }, aa
Use the perl module "Regexp::Common". It has a nice balanced parenthesis Regex that works well.
# ASN.1 use Regexp::Common; $bp = $RE{balanced}{-parens=>'{}'}; @genes = $l =~ /($bp)/g;