in reply to Extracting multiple matches from Reg Ex

a larger sample data set would be more useful, as your first example is substantially different to the second. but in any case it sounds like you'll have variable number of tokens/words, each inside a round bracket pair. rather than trying to match the whole set of tokens in one go with a complex regex, probably better to match each token with a regex and use g modifier to create a loop..wherein you can create a array or even linked list structure for the one line of data. a linked list structure in perl becomes a easily navigable hash, and you can even make decisions based on matching a particular token at a given level, if further data semantic type validation is required.
note in the regexes i personally prefer the idiom starting delimiter, followed by not ending delimiter, followed by ending delimiter; so as not to accidentally eat up too much with a .*
example untested code..insert own code where comments are
while($text=<>) { chomp $text; // undef/reset preferred data structure before loop while($text=~/\([^)]+\)/g) { $token=$1; // append token to chosen data structure and such } }
the hardest line to type correctly is: stty erase ^H