var ftsoufun_HOST4369a88cf1149="http://localhost";
var ftsoufun_TARGET4369a88cf1149="http://localhost/ds/";
var FLASH_WIDTH4369a88cf1149=120;
var FLASH_HEIGHT4369a88cf1149=200;
var FLASH_SOURCE4369a88cf1149="http://localhost/ad2/weierxia/ad-wrx-ls.swf";
如上字符串,我想取出http://localhost/ad2/weierxia/ad-wrx-ls.swf请问如何取出。。谢谢

解决方案 »

  1.   

    something like (didn't test)String s = ".........";
    Regex re = new Regex(@"var\s+FLASH[^=]+=""(?<link>http://[^""]+)"");
    Match m = re.Match(s);
    if (m.Success)
     Console.WriteLine(m.Groups["link"].Value);
      

  2.   

    String s = @"var ftsoufun_HOST4369a88cf1149=""http://localhost"";
    var ftsoufun_TARGET4369a88cf1149=""http://localhost/ds/"";
    var FLASH_WIDTH4369a88cf1149=120;
    var FLASH_HEIGHT4369a88cf1149=200;
    var FLASH_SOURCE4369a88cf1149=""http://localhost/ad2/weierxia/ad-wrx-ls.swf"";
    ";Regex re = new Regex(@"var\s+FLASH[^=]+=""(?<link>http://[^""]+)");
    Match m = re.Match(s);
    if (m.Success)
     Console.WriteLine(m.Groups["link"].Value);
      

  3.   

    思归大哥高人啊。还有,我想问一下,如果取以http://开头和以.swf结束的话,其中不包括
    一些特殊字符如:(";)等,怎么写。
      

  4.   

    Regex re = new Regex(@"var\s+FLASH[^=]+=""(?<link>http://[^;""]+.swf)""");