Use .slice() over .replace() to save RegExp lookup