169: replace(/re/g, function(){/*weird stuff*/})

I tried another approach, similar to yours, a single regexp-replace pass.
Results are in reverse order again :)