Transform Rules with regex_replace

We recently upgraded our site from Magento1 to Magento2. M2 is is using different formatting for price filters


because of this when customers are following old users, they are greeted with an error saying “There has been an error processing your request”; and the exception logs gets an entry. If we change the comma to hyphen, then the M1 URLs are working. For this I wanted to use “Transform Rules” and after some search did the following rule:

When incoming requests match
(http.request.uri.query matches “(price=)(\d{0,9})(,|%2C)(\d{0,9})”)

then write
path = preserve
Query = regex_replace(http.request.uri.query, “(price=)(\d{0,9})(,|%2C)(\d{0,9})”, “price=${2}-${4}”)

strangely this is not working!!! I even accounted for character comma (,) as well as encoded value (%2C) and checked it on regex101; it worked ( but on Cloudflare its not working.

any pointers?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.