日期:2014-05-18  浏览次数:20810 次

求一个正则表达式向腾讯qq聊天界面那种匹配网址
源字符串:dddddddddddhttp://www.rczjp.cn/A/B/C/index.aspx?cid=11&sid=22中文呢?

匹配后:http://www.rczjp.cn/A/B/C/index.aspx?cid=11&sid=22


谢过了!

------解决方案--------------------
C# code
 string test_str = "dddddddddddhttp://www.rczjp.cn/A/B/C/index.aspx?cid=11&sid=22中文呢";
                string pattern = @"(?i)http://[^\u4e00-\u9fa5]+";
                test_str = Regex.Match(test_str, pattern).Value;//http://www.rczjp.cn/A/B/C/index.aspx?cid=11&sid=22