下面这两个正则表达式:
/^ab|cd$/
/^(ab|cd)&/
为什么匹配的结果不一样呢,求解
------解决方案--------------------
------解决方案--------------------
- JScript code
var s = '1d12f3f1'; var re = /(?=[\da-z]{4,10})(?!^(\d+|[a-z]+)$).+/i; alert(re.test(s))
var s = '1d12f3f1'; var re = /(?=[\da-z]{4,10})(?!^(\d+|[a-z]+)$).+/i; alert(re.test(s))