There already is a "placeholder". Unmatched groups pop an array index matching the group number with an undefined value. e.g.
var someString = "match2";
var matches = someString.match(/\s*(match1)?\s*(match2)?(match3)?\s*/i);
matches
now has
["match2", undefined, "match2", undefined]
Element 0
is the complete regex match and elements 1-3 are the individual groups
So you can do for example...
// check if group1
if (typeof matches[1] != 'undefined')