哪位高手帮小弟我匹配下URL
程序员文章站
2022-06-17 14:57:58
...
谁帮我匹配下URL
Mar 8 12:51:26 10.10.255.5 haproxy[4843]: 124.240.42.88:54351[10.10.255.5:36672]->121.14.0.101:80[121.14.0.101:80] [08/Mar/2012:12:51:26.627] http_check http_image/ 6/0/9/10/26 200 1520 - - ---- 500
/500/9/0/0 0/0 {news.sohu.com|http://wei.sohu.com/s2011/wei/?20120308} "GET /upload/sogou_world_20100618/h_bg_tag74on.gif HTTP/1.1"
------解决方案--------------------
$log = '
Mar 8 12:51:26 10.10.255.5 haproxy[4843]: 124.240.42.88:54351[10.10.255.5:36672]->121.14.0.101:80[121.14.0.101:80] [08/Mar/2012:12:51:26.627] http_check http_image/ 6/0/9/10/26 200 1520 - - ---- 500
/500/9/0/0 0/0 {news.sohu.com|http://wei.sohu.com/s2011/wei/?20120308} "GET /upload/sogou_world_20100618/h_bg_tag74on.gif HTTP/1.1"
';
preg_match('/http:\/\/(.*?)\s*}/s', $log, $m);
print_r($m[1]);
------解决方案--------------------
"#://([^/]+)#"
Mar 8 12:51:26 10.10.255.5 haproxy[4843]: 124.240.42.88:54351[10.10.255.5:36672]->121.14.0.101:80[121.14.0.101:80] [08/Mar/2012:12:51:26.627] http_check http_image/
/500/9/0/0 0/0 {news.sohu.com|http://wei.sohu.com/s2011/wei/?20120308} "GET /upload/sogou_world_20100618/h_bg_tag74on.gif HTTP/1.1"
------解决方案--------------------
$log = '
Mar 8 12:51:26 10.10.255.5 haproxy[4843]: 124.240.42.88:54351[10.10.255.5:36672]->121.14.0.101:80[121.14.0.101:80] [08/Mar/2012:12:51:26.627] http_check http_image/
/500/9/0/0 0/0 {news.sohu.com|http://wei.sohu.com/s2011/wei/?20120308} "GET /upload/sogou_world_20100618/h_bg_tag74on.gif HTTP/1.1"
';
preg_match('/http:\/\/(.*?)\s*}/s', $log, $m);
print_r($m[1]);
------解决方案--------------------
"#://([^/]+)#"
相关文章
相关视频