C#正则表达式——网游角色起名仅允许汉字、字母、数字、底划线
using System.Text.RegularExpressions;
static public bool RegexName(string str)
{
return Regex.IsMatch(str, @"^[\u4e00-\u9fa5_a-zA-Z0-9]+$");
}
using System.Text.RegularExpressions;
static public bool RegexName(string str)
{
return Regex.IsMatch(str, @"^[\u4e00-\u9fa5_a-zA-Z0-9]+$");
}
暂无评论。
评论功能维护中,当前仅展示历史评论。