Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic parameter regex replacement in processComplexMatch #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erikjuhani
Copy link

Hey again @wesleytodd! 👋

One test case was failing as mentioned in my other pr #64. This should fix that issue!

The replace failed to inject the route parameter as the layer regex was changed from /^\/(?:([^\/]+?))\/?(?=\/|$)/i to /^(?:\/([^/]+?))\/?(?=\/|$)/i.

Now both regex cases are taken into consideration. The regex was changed to use optional non-capturing groups for the differences between the two possible regex patterns.

Link to playground using the new regex format: https://regex101.com/r/cursDu/1

The replace failed to inject the route parameter as the layer regex was
changed from `/^\/(?:([^\/]+?))\/?(?=\/|$)/i` to `/^(?:\/([^/]+?))\/?(?=\/|$)/i`.

Now both regex cases are taken into consideration. The regex was changed
to use optional non-capturing groups for the differences between the two
possible regex patterns.

Link to playground using the new regex format: https://regex101.com/r/cursDu/1
@erikjuhani erikjuhani force-pushed the fix-routes-in-a-different-file-test branch from 4280f48 to 2bdd2fc Compare September 21, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant