my understanding about how js regex objects work is that the regex object has match state.  Because I'm doing a global search, I have to call RegEx.exec multiple times, each time the regex object's pointer to the last index is changed.  If I don't recreate the regex object in the loop, wouldn't I break this pattern -- or does the api know enough to invalidate the state if the search string changes between exec calls?