现在的位置: 首页 > 综合 > 正文

正则表达式,查找的功能。

2013年06月08日 ⁄ 综合 ⁄ 共 838字 ⁄ 字号 评论关闭

 // 最近在做字符串的处理,后面有看到了,正则表达式,所以, 看到编的//方面还有待提高。这个模式匹配比较好,速度比较快。是一般的string 的类是无法比拟的。

string Text =
            @"XML has made a major impact in almost every aspect of software development
                Desigener as an open ,extensible ,self_desecibling language,
                it has become the standard for data and document delivery at breakneck
                The panoply of xml-ralted technologies continues to develop at breakneck
                speed ,to enable validation ,navigation,transformation,linking ,querying,
                descipition ,and messaging of data";
            //string Pattern="ion";
            string Pattern = @"/bl/S*ing/b";
            MatchCollection Matches = Regex.Matches(Text, Pattern, RegexOptions.None);
            foreach(Match NextMatch in Matches)
            {
                Console.WriteLine(NextMatch.Index);
                Console.WriteLine(NextMatch.Value);
            }

抱歉!评论已关闭.