| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 456 人关注过本帖
标题:按网上的例子,但怎么匹配不成功的呢
只看楼主 加入收藏
liaohongchu
Rank: 1
等 级:新手上路
帖 子:133
专家分:0
注 册:2008-4-25
结帖率:78.72%
收藏
 问题点数:0 回复次数:0 
按网上的例子,但怎么匹配不成功的呢
string text = "I'vefoundthisamazingURLathttp://www.,andthenfindftp://ftp.
            string pattern = @"b(?<protocol>S+)://(?<address>S+)b";
            MatchCollection mc = Regex.Matches(text,pattern);
            Response.Write("文本中包含的URL地址有:");
            foreach(Match match in mc)
            {
                GroupCollection gc = match.Groups;
                string outputText = "URL:" + match.Value + ";Protocol:" + gc["protocol"].Value + ";Address:" + gc["address"].Value;
                Response.Write(outputText);
            }

都没有匹配到,为空, 哪里不对了
搜索更多相关主题的帖子: protocol address 网上 
2011-04-13 09:05
快速回复:按网上的例子,但怎么匹配不成功的呢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016961 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved