public function test(){
$str = '_333httpwww://www.youku.com/show_page/id_ABCDEFG.html';
//^非
// / / 标记开始和结束
// ^http:\/\/ =>匹配不是http://
// \w 匹配任何字类字符,包括下划线。与“[A-Za-z0-9_]”等效。
// . 匹配除“\n”之外的任何单个字符。
//$a = '/^http:\/\/([\w.]+)\/([\w]+)\/([\w]+)\.html$/i';
//+匹配到不是的就停止
//^开头
//\w-表示 任何字类字符在加上-
//\d 匹配数字
//列1
$a = '/([\w.]+)/';
$a1 = '/([\w.]+)/';
$a2 = '/http([\w.]+)/';
$a3 = '/youku.([\w.]+)\/([\w]+)/';
$a4 = '/^http/';
preg_match($a, $str, $matches);
preg_match($a1, $str, $matches1);
preg_match($a2, $str, $matches2);
preg_match($a3, $str, $matches3);
preg_match($a4, $str, $matches4);
dump($matches);
$view = new View();
return $view->fetch('Timelist/test');

}
posted on 2017-09-22 09:36  mll123  阅读(132)  评论(0编辑  收藏  举报