1.判断是否不存在全角字符或全角数字:
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/
示例(js代码):
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/.test('abc123') // true
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/.test('abc123') // false
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/
示例(js代码):
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/.test('abc123') // true
/^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$/.test('abc123') // false