Extra capture group at tuckey

I am trying to use an optional capture group in a tuckey outbound rule, but it does not work. Any help on this would be greatly appreciated.

Can I use the format (. +)? as an optional capture group in tuckey. When I tried in apache, it works fine, but in Tuckey it doesn't work. I even tried to run away ?, but still not working.

For example, I have two types of URLs

http: // xxx / discontinued-products / token / - categories% 3C% _c_discontinued_category% 7D-- http: // xxx / token / - categories% 3C% _c_discontinued_category% 7D--

I'm trying to write an outbound rule to rewrite a few words in a URL, but I want the rule to apply to the above URL. So I used a rule starting with the following.

In From

^ /? (. +)? / Marker /

In to

$ 1 / marker /

+4
source share
1 answer

Try:

^/(.+)?token/(.+)?$

To:

/$1?token/$2

I did not test it in a real environment, but the regex test showed that it catches both expressions from.

0
source

Source: https://habr.com/ru/post/1606449/


All Articles