nit: since your using new RegExp instead of /, you should add an extra \ to the \s in the string.