<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>测试 </title>
    <meta http-equiv="Refresh" content="1;url=http://rich.mail.richcode.com/cgi-bin/loginpage?f=xhtml&s=verifycode&[email protected]&clientuin=779703486&mss=1&autologin=n&plain=&ppp=c2p7c3tmbT1wfWQE&spcache=&tfcont=22%20serialization%3A%3Aarchive%205%200%200%208%200%200%200%208%20authtype%201%208%209%20clientuin%209%20779703486%209%20aliastype%207%20%40qq.com%206%20domain%206%20qq.com%201%20f%205%20xhtml%203%20uin%209%20779703486%203%20mss%201%201%207%20btlogin%204%20%E7%99%BB%E5%BD%95" />
    <link href="http://w.mail.richcode.com/cgi-bin/getcss?fn=m.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http- equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="thu, 01 jan 1970 00:00:00 gmt" />
</head>
<body>
    <div class="titlebar tbold">
        测试</div>
    <div class="content2">
        测试</div>
</body>
</html>
把红色部分匹配出来 ,跪求!!!

解决方案 »

  1.   


    preg_match('/<meta http-equiv="Refresh" content="1;url=([^"]+)"/i',$str,$matches);
    print_r($matches);
      

  2.   


    preg_match('/<meta http-equiv="Refresh" content="1;url=(.*?)"/i',$str,$matches);
    print_r($matches);
      

  3.   

    $pattern = '/\<meta http\-equiv=\"refresh\" content=\"1;url\=(.+?)\" \/\>/is';preg_match($pattern, $html, $matches);
    print_r($matches);测试过可用。
      

  4.   

    preg_match('/<meta http-equiv="Refresh" content="1;url=[\s\S]*"/i, $str, $arr); var_dump($arr);
      

  5.   

    需求不是很详细,只能这样:
    preg_match('/<meta http-equiv="Refresh" content="1;url=([^"]+)"/i',$str,$matches);
    print_r($matches);
      

  6.   

    preg_match_all(“/url=\"([\s\S]+?)\"/i”, $str, $arr); 
    print_r($arr);
      

  7.   

    preg_match('/<meta http-equiv="Refresh" content="1;url=([^"]+)"/i',$str,$matches);
    print_r($matches);