Cannot use function regex_replace (Code: undefined)

We’re unable to create a new transform rule.

Here’s what we’re using.

When incoming requests match…
starts_with(http.request.uri.path, “/guide/”) and not http.request.uri.query contains “guide”

Then… Rewrite Path

Rewrite to… Dynamic
regex_replace(http.request.uri.path, “^/guide/tim/(.*)", "{1}”)

On save of draft or deploy, we get the error:
cannot use function regex_replace (Code: undefined)

This is really vague and I can’t seem to figure out what the underlying issue is.

Looks like my formatting didn’t work. Also worth pointing out that the rewrite has the dollar sign in it before the group ID.

Update, just realized that regex support is not available in Pro plans for some reason. :frowning:

Hi Rob,

You’re right - the regex functions are only available to Biz/Ent zones. This is the same on Firewall Rules, also. We need to make the error message much more helpful, however. I’ve raised a ticket with the team and we’ll address ASAP.

Thanks for bringing this to our attention!

2 Likes

I’m a new user, and just spent 2 hours around this… to find out that regex support is not available in Pro.

Not very nice. Regex should be on the Pro plan!
But at least you should either display only the available options for the active plan, or update the error.

If regex is not available in Pro plans, it means there’s no dynamic rewrite?
Or is there another way?

I, too, really wished regex support was available without having to jump to the next plan. We don’t use many other features that merit using the Business plan.

Oh boy, that’s annoying! Thanks for flagging all.

Spent a good 30 minutes tweaking my regex to eventually find this thread. An error indicating that I couldn’t use this on the free plan would be good.

I also spent a few minutes wondering what this error was about.
Please, count my +1 to get this fixed.