我正在使用XRegExp正則表達式。我想在我的角色之間有一個空格,我還需要有特殊字符啓用。我已設法添加特殊字符,但我無法獲得允許的空間。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匹配這個字母數字。
再次轉義反斜槓。 – 2014-12-17 13:21:30
@Avinash我可以知道在哪個位置 – TomPHP 2014-12-17 13:23:44
'XRegExp(「^ [\\ p {L} \\ d] +(?:\\ s + [\\ p {L} \\ d] +)* $」) ;' – 2014-12-17 13:24:24