Typecho/Router/Parser.php中的parse方法里面的正则表达式是啥意思?附代码:publicfunctionparse(){$result=array();foreach($this->_routingTableas$key=>$route){$this->_params=array();//在_routingTables,[regx]=>|^/attachment/([0-9]+)[/]?$|$route['regx']=preg_replace_callback("/%([^%]+)%/",array($this,'_match'),//[url]=>/attachment/[cid:digital]/preg_quote(str_replace(array('[',']',':'),array('%','%',''),$route['url'])));/**处理斜线*/$route['regx']=rtrim($route['regx'],'/');$route['regx']='|^'.$route['regx'].'[/]?$|';$route['format']=preg_replace("/\[([^\]]+)\]/","%s",$route['url']);$route['params']=$this->_params;$result[$key]=$route;}return$result;}
相关分类