Closed spsquared closed 6 months ago
the ()
is already a regex group and the )
marks the end. Therefore you need to escape the closing )
: https://paths.esm.dev/?p=AAMsIPQgYAEL9lNgQAECUgPgDIFoDiiAwA5sbTACwBgAXQR0GqDkngCA&t=/abacac#. Note in JS strings, you need to escape the \
too
Reproduction
https://codesandbox.io/p/sandbox/vue-router-params-regex-bug-kdcvvs
Steps to reproduce the bug
(.)
)Expected behavior
The router extracts the regexp from inside the parenthesis and uses
(.)
as its regexp.Actual behavior
An error occurs as the syntax is included as part of the extracted regexp.
Additional information
(.)
is a fairly dumb expression but(a[abc])+
also breaks it.