的正则表达式名? [英] Regex for Username?
本文介绍了的正则表达式名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用C#和jQuery用正则表达式有效的用户名。刚学:)到目前为止,我有
I am using C# and jQuery to valid a username with Regex. Just learning :) So far I have
UserName = "[a-zA-Z0-9]";
但是,这并不能阻止符号?如何确保没有符号或。或_?
But this doesn't stop symbols ? How to ensure that no symbols or " . " or " _ " ?
感谢
推荐答案
这正则表达式说:至少一个字母或数字你要从开始到结束的每一个字符是字母或数字
That regex says "At least one letter or number" you want "Every character from the start to the end is a letter or number"
"^[a-zA-Z0-9]+$"
这篇关于的正则表达式名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文