求一正则
http://222.54.214.227/ss/rf.php?site_id=15
用正则取=号后面的15
简单问题呀,算散分了。正则不会,不好意思呀!

解决方案 »

  1.   

    http://222\.54\.214\.227/ss/rf\.php\?site_id=(?<id>\d+)
      

  2.   

    trystring yourStr = ...............;
    Match m = Regex.Match(yourStr, @"http://222\.54\.214\.227/ss/rf\.php\?site_id=(?<id>\d+)", RegexOptions.IgnoreCase);
    if (m.Success)
    {
        MessageBox.Show(m.Groups["id"].Value);
    }
      

  3.   

    Regex re = new Regex(@"^.*site_id=(.*)$", RegexOptions.None);
                MatchCollection mc = re.Matches("http://222.54.214.227/ss/rf.php?site_id=15");
                foreach (Match ma in mc)
                {   
                    MessageBox.Show(ma.Groups[1].Value);
                }