我正在使用 XRegExp 正则表达式。我想在我的角色之间留一个空格,我还需要启用特殊字符。我设法添加了允许的特殊字符,但我不能允许空格。
我的正则表达式unicodeWord = XRegExp("^(\\p{L}|[0-9][\s])+$");
它允许像
欢迎
但不是
你好欢迎
//Alphanumeric validation
function isAlphanumeric(str) {
var unicodeWord = XRegExp("^[\p{L}\d]+(?:\s+[\p{L}\d]+)*$");
result = unicodeWord.test(str);
return result;
}
été altérée sûr générateurs
但是这个dosnt匹配这个字母数字。