可以通过下面两种格式的url地址:
1)含有ip地址的,http://192.168.0.120/index.php?name=
2)直接域名方式的,http://www.test.net/index.php?param==========
谢谢!正则表达式url

解决方案 »

  1.   

    (?is)https?://([a-z0-9]+\.)+[a-z0-9]+(/\S+)?$
      

  2.   

    仅就你这两个的格式而言,因为不知道参数那块还有什么情况            StreamReader reader = new StreamReader("c:\\temp\\1.txt",Encoding.Default);
                string source = reader.ReadToEnd();
                Regex reg = new Regex(@"http:[^?]+\?[^=]+=");
                MatchCollection mc = reg.Matches(source);
                foreach (Match m in mc)
                {
                    //comboBox1.Items.Add(m.Value);
                    MessageBox.Show(m.Value);
                }
      

  3.   

    ======
    只要能同时正则http://192.168.0.120/这种ip地址形式和
    http://www.test.net/  https://www.test.net/这种带域名形式的,
    后面的参数是正常的url形式的就可以了
    ==
    谢谢