Combining regular expressions in Javascript
The answer is yes! You have to initialize the variable under the RegExp class:
var lower = new RegExp(/--RegexCode--/);
var upper = new RegExp(/--RegexCode--/);
hence, regex can be dynamically created. After creation:
"sampleString".replace(/--whatever it should do--/);
Then you can combine them normally, yes.
var finalRe = new RegExp(lower.source + "|" + upper.source);
If regexps are not known beforehand,
var one = /[a-z]/;
var two = /[A-Z]/;
var one_or_two = new RegExp("(" + one.source + ")|(" + two.source + ")")