Let's say I had a string "QQxaxbxcQQ", and I wanted to capture all groups of x followed by any character. I also only want to search between the QQ's (the string may include other things in it). I assumed this would have worked:
var matches = str.match(/QQ(x\w)+QQ/)
However, this only seems to return to me the last match (xc). Can you point me in the right direction?
EDIT: the first version of my question was oversimplified. Apologies to original responders. Edited to make it closer to my actual problem.