Missed a place where the regex can be placed

var regex = foo ? /bar/ : /baz/

Update: in array
var regexs = [/foo/, /bar/];