I added an alias alias to the route. I want to judge that the similar addresses are / medium
, /% E9%97%AE
, but it doesn"t seem to match.
in path-to-regexp this expression online test tool tests normally, adding route records alone is normal, and aliases cannot match Chinese. Aliases can be matched with /: keyword
directly.
alone
{
name: "searchSingle",
path: "/:keyword([\u4E00-\uFE4F\u3400-\u4DB5\u3400-\u4DB5\u2F00-\u2FD5\uD800-\uDBFF\uDC00-\uDFFF]{1})",
component: SearchSingle
},
alias
{
name: "search",
path: "/s/:keyword",
component: MySearch,
alias: "/:keyword([\u4E00-\uFE4F\u3400-\u4DB5\u3400-\u4DB5\u2F00-\u2FD5\uD800-\uDBFF\uDC00-\uDFFF]{1}$)"
},