Can someone help write a single regex expression for a transform rule?
I’ve been unsuccessful at setting a transform rule to replace 1 query parameter.
We are trying to transform:
mysite.com/?alpha=something&utm...
to
mysite.com/?bravo=something&utm...
In other words we want to just change the “alpha” value in the query string to “bravo” and keep all the other utm parameters unchanged.
When I set up a Transform Rule to rewrite Query > Dynamic, Cloudflare rejects the syntax of my regex_replace. What is the correct string?
Here is what we have tried:
regex_replace(http.request.uri.path, 'alpha', 'bravo')
regex_replace(http.request.uri.path, '/alpha/', '/bravo/')
regex_replace(http.request.uri.path, /alpha/, /bravo/)
regex_replace(http.request.uri.query, ‘alpha’, ‘bravo’)
Cloudflare replies with:
Filter parsing error (1:38): regex_replace(http.request.uri.path, 'alpha', 'bravo') ^^^^^^^^^^^^^^^^^ unrecognised input (Code: 20089)