开发者

Looking for regex to allow spaces but doesn't allow special characters?

I'm implementing validation for registration form. One of the field is name, can 开发者_JAVA百科have spaces but I don't want users to put any special characters.


bool isValid = Regex.IsMatch(name, "^[a-z0-9 ]+$", RegexOptions.IgnoreCase);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜