<b>Fatal error</b>:  Uncaught exception 'Exception' with message '请提供正确的数据库连接对象,必须是MySqli类型。' in C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php:45
Stack trace:
#0 C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php(21): Manager_Authorization-&gt;Authorization(1231)
#1 C:\Program Files\WAMPServer\www\service\Cedar_Manager\do.php(9): Manager_Authorization-&gt;__construct('12', '56', 1231)
#2 {main}
  thrown in <b>C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php</b> on line <b>45</b><br />上面的文本是多行的,求正则锰的兄弟。给一个匹配的表达式。

解决方案 »

  1.   

    我想匹配。<b>Fatal error</b>: 任意换行和字符 <br />
      

  2.   


    $str = <<<eof
    <b>Fatal error</b>:  Uncaught exception 'Exception' with message '请提供正确的数据库连接对象,必须是MySqli类型。' in C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php:45
    Stack trace:
    #0 C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php(21): Manager_Authorization-&gt;Authorization(1231)
    #1 C:\Program Files\WAMPServer\www\service\Cedar_Manager\do.php(9): Manager_Authorization-&gt;__construct('12', '56', 1231)
    #2 {main}
      thrown in <b>C:\Program Files\WAMPServer\www\service\Cedar_Manager\class.php</b> on line <b>45</b><br />
    eof;
    if(preg_match('/<b>Fatal\s+error<\/b>:(.*)<br\s*\/?>/is',$str,$match)){
      print_r($match);
    }
      

  3.   

    如果要包括 <b>Fatal error</b>: 任意换行和字符 <br />
    if(preg_match('/(<b>Fatal\s+error<\/b>:.*<br\s*\/?>)/is',$str,$match)){
      print_r($match);
    }