我做错了什么,因为下面的两个字符串在下面false
测试时都返回了?
var pattern = "^[\s\da-zA-ZåäöÅÄÖ_]+$"
var reg = new RegExp(pattern);
console.log(reg.test("This should be invalid as it is full with invalid chars. #!¤%&/()=?"));
console.log(reg.test("This is an valid string, despite that Swedish chars such as ÅÄÖ are used"));