我需要一个 regex
来检查字符串只包含 A-Z
、a-z
和 特殊字符
但是 不是数字
即(0-9
)。
感谢您的帮助。
最佳答案
你可以试试这个正则表达式:
^[^\d]*$
和示例:
var str = 'test123';
if ( str.match(/^[^\d]*$/) ) {
alert('matches');
}
关于javascript - 如何检查javascript字符串中是否存在数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6187920/