Q:

subpattern regex

I need to retrieve all matches on a string with one regex:
var str = "lorem -req=aaa(opt:3,m:2),bbb(opt:4) ipsum ",
res = str.match(/.../); //  ???? 

what to use to obtain something like
[
  ['aaa', 'opt:3,m:2'],
  ['bbb', 'opt:4']
]

is it possible without using a function?

A:

You can try with this:
[=,]([^\(]*)\(([^\)]*)\)

Explanation
Group 1, and 2 contains your matches

