Getting error 20089 when applying regex rewrite

I have a system that generates a URL for an image but sometimes the source that generates it starts with a . and then there is a 404 on that image; and I need to drop that . from the URL (so for example - /images/.scan16.png should become /images/scan16.png).

I tried .*\.(.*).png which works to grab the file name from the URL as far as I can tell -
(full dynamic rule: regex_replace(http.request.uri.path, ".*\.(.*).png", "${1}.png"))
However when ever I tried to deploy I get a 20089 expected ^ and it makes no difference if I put a ^ at the start or not… what am I getting wrong here?


What about

regex_replace(http.request.uri.path, '/\.', '/')

Thanks for the reply, unfortunately same issue…

gives me this error:
'regex_replace(http.request.uri.path, '/\.', '/')' is not a valid value for path because the expression is invalid: Filter parsing error (1:38): regex_replace(http.request.uri.path, '/\.', '/') ^^^^^^^^^^^ unrecognised input (Code: 20089)

Also tried with " instead of ’ on your example with the same result.

Right, it seemingly should be double quotes. Also you need to escape the slash, but you’d need a Business plan.

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