Typecho中的路由规则,用 | (或运算符) 做正则的定界符问题
程序员文章站
2022-04-06 16:37:49
...
array(6) {
["url"] => string(1) "/"
["widget"] => string(14) "Widget_Archive"
["action"] => string(6) "render"
["regx"] => string(8) "|^[/]?$|"
["format"] => string(1) "/"
["params"] => array(0) {
}
}
regx中的值是用|斜杠做定界符,不是用/或#吗?preg_match()函数
回复内容:
array(6) {
["url"] => string(1) "/"
["widget"] => string(14) "Widget_Archive"
["action"] => string(6) "render"
["regx"] => string(8) "|^[/]?$|"
["format"] => string(1) "/"
["params"] => array(0) {
}
}
regx中的值是用|斜杠做定界符,不是用/或#吗?preg_match()函数
题目取的不好,自己看手册吧 http://php.net/manual/zh/regexp.reference.delimiters.php