webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How to use Regex in Gateway For Conditional Routing

  • 1.  How to use Regex in Gateway For Conditional Routing

    Posted Tue July 09, 2024 10:18 AM

    Hello Everyone,
    I Wan to use regex In conditional routing. Can anyone elaborate how we can do and what type expression we need that works in gateway

    ${request.path.regex[EXPRESSION]}

    Lets say we have a scenario that, I have to check if the request url end with xyz, How can I check that with regular expression.

    Url : https://host:port/internal/abc/xyz


    #API-Gateway
    #webMethods
    #API-Management


  • 2.  RE: How to use Regex in Gateway For Conditional Routing

    Posted Tue July 09, 2024 12:26 PM

    Might ${request.payload.regex[.*/xyz$]} work? If my regex isn’t rusty:

    .* – zero or more of any chars
    /xyz – literal
    $ – at end of string


    #API-Management
    #API-Gateway
    #webMethods


  • 3.  RE: How to use Regex in Gateway For Conditional Routing

    Posted Thu July 11, 2024 04:35 AM

    This worked with this regex ${request.payload.regex[//xyz$/]}.
    for my requirement i just has to check if the URL is ending with /xyz


    #webMethods
    #API-Gateway
    #API-Management