Escape the $ character in Page Rule's regex

Hello,

In our service we use the UriPaths which contain the $ character like /api/$smartContent. There is a case that I need to evaluate it in the Rules → Transfor Rules by the does not match regex. Unfortunately I do not know how to escape the $ character in Cloudflare’s regex parser. It seems to work differently.

I tried many ways like below but non of them work:

  • not http.request.uri.path matches “^/api/$smartContent”
  • not http.request.uri.path matches “^/api/$smartContent”
  • not http.request.uri.path matches “^/api/$$smartContent”

When I test it by using raw string like not http.request.uri.path contains "/api/$smartContent" it works, so my logic is proper.

Of course I cannot use the /api/$smartContent because it is dynamic, so my regex should look like ^/app/$.+ but as I mentioned - I do not know how to escape the $ character.

May I ask which plan are you using? :thinking:

I am afraid regex isn’t supported, at least not in Page Rules :thinking:
Furthermore, regex as we know it is only available on Business and Enterprise plans.

Nevertheless, I’d suggest you to take a look at Google RE2 instead.