- 用如下表达式表示包含数字的情况
/\D*\d/
- 至少包含三个数字的表示
/(?:\D*\d){3}/
测试:
/(?:\D*\d){3}/.test('aaawqdw') //false
/(?:\D*\d){3}/.test('aaa12wqdw') //false
/(?:\D*\d){3}/.test('a1aaw2qd3w') //true
Fighting's Blog
/\D*\d/
/(?:\D*\d){3}/
/(?:\D*\d){3}/.test('aaawqdw') //false
/(?:\D*\d){3}/.test('aaa12wqdw') //false
/(?:\D*\d){3}/.test('a1aaw2qd3w') //true