//var %stuff = (stuff inside brackets) blah blah (more stuff) blah (and even more stuff here) how about (this is the final sstuff), %matches = $regex(%stuff,/\((.*?)\)/gi), %cur = 1 | while (%cur <= %matches) { echo -a match# $+ %cur $+ : $regml(%cur) | inc %cur }


key parts being:


$regex(%stuff,/\((.*?)\)/gi)

and

$regml(N) to get the Nth match for items found within ( and )