next-routes icon indicating copy to clipboard operation
next-routes copied to clipboard

Negative regex matches

Open stevenmusumeche opened this issue 5 years ago • 1 comments

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 avatar Jun 19 '19 16:06 stevenmusumeche

@stevenmusumeche, hey is there any workaround?

dima-kov-prepler avatar Apr 12 '22 13:04 dima-kov-prepler