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

Support for Full URL and Wildcards #6

Open
drveresh opened this issue Dec 8, 2018 · 1 comment
Open

Support for Full URL and Wildcards #6

drveresh opened this issue Dec 8, 2018 · 1 comment

Comments

@drveresh
Copy link

drveresh commented Dec 8, 2018

Hi,

This seems to work only with relative URLs. Can you please extend the functionality to support full-length URLs as well? We need the solution for below use cases:

1. Sub-string match
Input URL: www.amazo.com/xyz/dp/B00UIIDP06/ref=sr_1_1_sspa?s=photo
Matcher: routeMatcher("/dp/:asin/:extra");
Results: null, it doesn't work because it is expecting the input as "dp/B00UIIDP06/ref=sr_1_1_sspa.."
Ideal Case: It should just check the pattern exist in give full-length URL. If it is expected, then we need to manually extract the relative URL then feed to this.

2. Forced expression
Input URL: www.amazo.com/xyz/dp/B00UIIDP06/ref=sr_1_1_sspa?s=photo
Matcher: routeMatcher("/dp/:asin/");
Results: null, it doesn't work because it is expecting to cover even beyond "/B00UIIDP06/", for "/ref=sr_1_1_sspa?s=photo"
Ideal Case: There is no need to check beyond what is required(/dp/:asin/). In case, if there are multiple params/sections like "/abc/edf/zya/ref=sr_1_1_sspa?blah..", then we should extend the expression to really long

3. How to cover before/after from the matching point, like Wildcards? Similar to https://www.npmjs.com/package/route-pattern?

Input URL: www.amazo.com/xyz/dp/B00UIIDP06/ref=sr_1_1_sspa?s=photo
Matcher(expected): routeMatcher("[*before]dp/:asin/[*after]");
Ideal Case: It is useful to know before/after URL parts when a given pattern is matched

Thanks and appreciating your support!

@drveresh
Copy link
Author

@cowboy Any updates on this?

I am eagerly waiting for these features and there too many use cases depend on URL sub-string matching.

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

No branches or pull requests

1 participant