求高手,如何用正则表达式判断字符串中连续的大小写字母,数字
展开全部
采用逆向思路来写,虽然长,但也不是长得不可接受,如下:
^(?:(?!a[ac-z]|b[abd-z]|c[a-ce-z]|d[a-df-z]|e[a-eg-z]|f[a-fh-z]|g[a-gi-z]|h[a-hj-z]|i[a-ik-z]|j[a-jl-z]|k[a-km-z]|l[a-ln-z]|m[a-mo-z]|n[a-np-z]|o[a-oq-z]|p[a-pr-z]|q[a-qs-z]|r[a-rt-z]|s[a-su-z]|t[a-tv-z]|u[a-uw-z]|v[a-vxyz]|w[a-wyz]|x[a-xz]|y[a-y]|z[a-z]|0[02-9]|1[013-9]|2[0-24-9]|3[0-35-9]|4[0-46-9]|5[0-57-9]|6[0-689]|7[0-79]|8[0-8]|9[0-9])[a-z\d])+$
^(?:(?!a[ac-z]|b[abd-z]|c[a-ce-z]|d[a-df-z]|e[a-eg-z]|f[a-fh-z]|g[a-gi-z]|h[a-hj-z]|i[a-ik-z]|j[a-jl-z]|k[a-km-z]|l[a-ln-z]|m[a-mo-z]|n[a-np-z]|o[a-oq-z]|p[a-pr-z]|q[a-qs-z]|r[a-rt-z]|s[a-su-z]|t[a-tv-z]|u[a-uw-z]|v[a-vxyz]|w[a-wyz]|x[a-xz]|y[a-y]|z[a-z]|0[02-9]|1[013-9]|2[0-24-9]|3[0-35-9]|4[0-46-9]|5[0-57-9]|6[0-689]|7[0-79]|8[0-8]|9[0-9])[a-z\d])+$
追问
谢谢
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询