next-routes
next-routes copied to clipboard
Negative regex matches
I'm trying to match a catch-all route which matches all paths except those that end with .ico
. The regular expression for this is straightforward:
.add(`/:path(?!.*ico)`, 'static-content')
however, I get the following error, because the exclamation point is being escaped.
SyntaxError: Invalid regular expression: /^\/(?\!.*ico)(?:\/)?$/: Invalid group
@stevenmusumeche, hey is there any workaround?