分隔符不得为字母数字或反斜杠

时间:2012-11-23 04:39:24

标签: php regex

这个正则表达式有什么问题?尽管使用/i转义,我仍然会收到错误'分隔符不能是字母数字或反斜杠'。

$tokenregex = '/sid(.*)/i';


$bizresponse=curl_getinfo ($curlop1);
$bizresponse = print_r($bizch);


if (preg_match($tokenregex[1], $bizresponse))

{
do things
}

bizresponse就是这个

TTP://anonymouse.org/cgi-bin/anon-www.cgi/http://ca.isohunt.com/member.php原点= /论坛/ index.php的&安培; SSL =否安培; SID = 915625588370db24a51d713871a3ec1a [content_type] =>为text / html; charset = utf-8 [http_code] => 200 [header_size] => 1417 [request_size] => 627 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 1 [total_time] => 2.666479 [namelookup_time] => 3.8E-5 [connect_time] => 0.168507 [pretransfer_time] => 0.168547 [size_upload] => 0 [size_download] => 39526 [speed_download] => 14823 [speed_upload] => 0 [download_content_length] => 415 [upload_content_length] => 0 [starttransfer_time] => 0.778169 [redirect_time] => 1.383665 [certinfo] => Array()[redirect_url] => )

1 个答案:

答案 0 :(得分:-1)

if (preg_match($tokenregex[1], $bizresponse))中,$tokenregex[1]的值为s,这里会产生错误。将$tokenregex[1]替换为$tokenregex