当前位置:编程学习 > C#/ASP.NET >>

请教一个读取HTML中所有中文汉字的正则表达式

请教一个读取HTML中所有中文汉字的正则表达式 --------------------编程问答-------------------- for example:

            string str = "abc我def爱sdf老婆123";
            MatchCollection matchs = Regex.Matches(str, @"[\u4e00-\u9fa5]+");
            foreach (Match  m in matchs)
            {
                Console.WriteLine(m.Value);
            }
--------------------编程问答-------------------- 输出:


老婆 --------------------编程问答-------------------- --------------------编程问答-------------------- 帮顶。。。 --------------------编程问答--------------------
string result=Regex.Replace("你的HTML内容",@"[^\u4e00-\u9fa5]",""); 
--------------------编程问答--------------------
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,