C#正则表达式——网游角色起名仅允许汉字、字母、数字、底划线

        using System.Text.RegularExpressions;

        static public bool RegexName(string str)
        {
            return Regex.IsMatch(str, @"^[\u4e00-\u9fa5_a-zA-Z0-9]+$");
        }

猜你喜欢

转载自kenkao.iteye.com/blog/2394789