匹配中文字符
[/u4e00-/u9fa5]
C#
復(fù)制代碼代碼如下:
class Class1
{
static void Main()
{
string s = "中文 chinese";
Regex regx = new Regex("[/u4e00-/u9fa5]+");
Match m = regx.Match(s);
Console.WriteLine(m.Groups[0].Value); // 中文
Console.ReadKey();
}
}
匹配雙字節(jié)字符(包括漢字)
[^/x00-/xff]