URLPattern
- URLPattern
- wicg urlpattern
- 语法基于 path-to-regexp
/posts/*
/books/:id
,/books/:id?
/books/:id+
/books/:id*
/books{/old}?
,/books/(^\d)
/books/:id(\\d+)
/blog/:id(\\d+){-:title}?
'data\\:foo*'
- data url/*.:filetype(jpg|png)
- Chrome 95+
- polyfill kenchris/urlpattern-polyfill
new URLPattern({ pathname: '/books/:id' }).exec('https://example.com/books/123').pathname.groups;