Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在app router中使用带路径变量的regex mix_Regex_Polymer - Fatal编程技术网

如何在app router中使用带路径变量的regex mix

如何在app router中使用带路径变量的regex mix,regex,polymer,Regex,Polymer,我有一个网址: <a href="/article/category/catalog/title"></a> 当我单击该url时,它应该匹配路由器,即,article matches article,category matches\w,catalog matches\w,title matches:title,因为我希望将title变量传递到另一个自定义元素以查询db,我如何实现这一点?您的正则表达式有问题吗,或者问题在于应用程序路由器?当路径模式为/^\/

我有一个网址:

<a href="/article/category/catalog/title"></a>



当我单击该url时,它应该匹配路由器,即,article matches article,category matches
\w
,catalog matches
\w
,title matches
:title
,因为我希望将title变量传递到另一个自定义元素以查询db,我如何实现这一点?

您的正则表达式有问题吗,或者问题在于
应用程序路由器
?当路径模式为/^\/article\/\w+\/\w+\/\w+//i时,它将匹配该url,但标题不能是传递给自定义元素的参数
<app-route path="/^\/article\/\w+\/\w+/\/:title/i" regex import="/pages/article/content-page.html"></app-route>