Two replace calls with simpler regular expressions are faster than one replace call with a complex one. This is true in Perl, and I'm assuming the same for JavaScript.