Let replaceText() handle REs with no group.
Let replaceText() handle REs with no group.

It turns out that the loop condition is just slightly off.
The loop must only run as long as the next text token is still
in the array, not the end of the next run of delimiter tokens.

cburschka/jquery-replacetext