Your regular expression is long and requires an unnecessary amount of parsing. /[.+?]/g is slightly more efficient.