Read the blog post on how to package a module with ES2015+ source code base to npm under CommonJS/ES2015/UMD format.
This example uses the umd build and is coded in plain, untranspiled ES6. You can find more example here.
/router/posts/:category/:title/edit
/^\/router\/user\/([^\/?#]+)\/([^\/?#]+)$/i