News

In some regex implementations there are only nine of them, however, with most contemporary Javascript implementations you can have up to 99 such capture-groups (where such groups are 1-based).
It's been a while since I worked on regexs in JavaScript, but generally the way you do this in most programming languages is to build the regex as a string and then pass it into the regex engine.