You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However because there's a positive lookahead in the pattern I think the error is requesting it must not start with ? because this code takes into account the ? in the beginning of any search params string. It would seem that you can't use a ? in the regex because of this collision.
Right, URLPattern is not very useful for filtering on specific query parameters because of the ordering issue. We could enahance the API to better support this, but right now its perhaps more natural to use something like URLSearchParams.
I think to solve this we would need to find a reasonable API shape and somehow prove out it would be effective with web developers.
Currently search query parameters are fixed and matches will only occur if they are in the URL in the same order.
Realizing this I sought out to create a regex pattern that would help solve this:
This regex will require
alpha
andbeta
but will also match extra query parameters.Here's the match working:
However because there's a positive lookahead in the pattern I think the error is requesting it
must not start with ?
because this code takes into account the?
in the beginning of any search params string. It would seem that you can't use a?
in the regex because of this collision.I just thought I'd document this behavior for others. Feel free to merge / close this ticket.
The text was updated successfully, but these errors were encountered: