正则表达式为字母数字 [英] Regex for alphanumeric

查看:103
本文介绍了正则表达式为字母数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要有一个正则表达式来接受长度为6到15的字母或字母数字,并且不应该只接受数字。

i有这个,^ [a-zA-Z0-9] + $ ....但不是根据我的reg

解决方案

....但不是根据我的reg


试试这个

 ^(?=。* [a-zA-Z] +。*)[0-9a-zA-Z] {6,15} 



我在Regxlib.com [ ^ ]


Need to have a regex for accepting alphabets or alphanumeric with the length of 6 to 15, and should not accept numeric only.
i have this one , ^[a-zA-Z0-9]+$.... but not according to my reg

解决方案

.... but not according to my reg


Try this

^(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{6,15}



Which I adapted after typing "Password" into the search engine at Regxlib.com[^]


这篇关于正则表达式为字母数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆