Remove modification of String.prototype

Replace with a short regex removing the need for a function call.