Skip to content

Support for Full URL and Wildcards #6

@drveresh

Description

@drveresh

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions