C# Regular Expression——Online game character names only allow Chinese characters, letters, numbers, and underscores

        using System.Text.RegularExpressions;

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326080756&siteId=291194637