Tenés que escapar los slashes:
Código Javascript
:
Ver originalvar patron03 = /^[a-zA-Z\s]*$/;
var patron04 = new RegExp("^[a-zA-Z\s]*$");
console.log(patron03.toString() == patron04.toString()); // false
var patron03 = /^[a-zA-Z\s]*$/;
var patron04 = new RegExp("^[a-zA-Z\\s]*$");
console.log(patron03.toString() == patron04.toString()); // true