But if the "|"s are at the top level -- which I believe they are in this case -- then you can have an array of _actual_ RegExp objects, and iterate over the array calling exec() on each one in turn.  I'm guessing that wouldn't be appreciably less efficient than glomming them all together with "|"...