Skip to content

Path template configuration with regular expressions #753

Closed

Description

@miqh

Hello,

I went through the documentation page on routing and didn't notice any mention for using regular expressions in path template properties.

After haphazardly experimenting with different expressions for UpstreamPathTemplate, I noticed a simple expression like (.+) appeared to be able to match against input, but I couldn't figure out whether the captured group could be used in DownstreamPathTemplate. Or perhaps this was purely coincidental behaviour.

I just wanted to ask whether or not there was support for using regular expressions to capture fragments of a route. If there's any documentation I missed regarding this, please point me in the right direction.

Currently using version 12.0.1.

Thanks in advance.

Activity

  1. added
    feature
    accepted
    in progress
    on Jan 16, 2019
  2. philproctor commented on Jan 16, 2019

    @philproctor
    Contributor

    This will be resolved as part of my work on #737

    Currently regex will work in the path, but the capture groups cannot be sent to the downstream. After this work, this will be possible.

  3. self-assigned this
    on Jan 16, 2019
  4. miqh commented on Jan 16, 2019

    @miqh
    Author

    @philproctor, that's great to hear! Thanks for the update. 🙌

  5. GadgetGeekUK commented on Oct 18, 2019

    @GadgetGeekUK

    Would this allow routing restrictions, so that if certain values appear in the upstream route they will go to destination 1, if others appear go to destination 2?

    Defining 2 ReRoutes is fine, but I want to have something like:

    myurl/customer/(Bob|Andy)/accounts go to destination 1,
    myurl/customer/(Other|Any|None)/accounts go to destination 2

    Thanks.

  6. szymonpiekny commented on Feb 22, 2022

    @szymonpiekny

    Something new?

  7. added
    proposal
    needs feedback
    and removed
    in progress
    feature
    accepted
    on Jan 7, 2024
  8. raman-m commented on Jan 7, 2024

    @raman-m
    Member

    @philproctor commented on Jan 16, 2019:

    This will be resolved as part of my work on #737

    Aha! The #737 issue is closed by me. Reason: No communication.

  9. raman-m commented on Jan 7, 2024

    @raman-m
    Member

    @miqh commented on Jan 16, 2019:

    I went through the documentation page on routing and didn't notice any mention for using regular expressions in path template properties.

    Regular expressions in templates are not supported/implemented!


    After haphazardly experimenting with different expressions for UpstreamPathTemplate, I noticed a simple expression like (.+) appeared to be able to match against input, but I couldn't figure out whether the captured group could be used in DownstreamPathTemplate. Or perhaps this was purely coincidental behavior.

    coincidental behavior


    I just wanted to ask whether or not there was support for using regular expressions to capture fragments of a route. If there's any documentation I missed regarding this, please point me in the right direction.

    No documentation at all! Not implemented!
    If you need this feature → Please contribute!

  10. locked and limited conversation to collaborators on Jan 7, 2024
  11. converted this issue into a discussion #1906 on Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs feedbackproposal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions