Regex not matching as expected in firewall rules

the following regex does not match the following URI path, which otherwise is a valid regex

Regex: ^/jewellery/.±[^/]±.+html
URI path : /jewellery/abstract-wife-18ktgold-specialday.html

Any clues what might be going wrong here?

Are you at least on a Business plan?

The expression in general does not match, that is not Cloudflare specific.

For example ± is probably not of much use there.

yes i am on business plan. this editor did something wrong with the text i pasted. Attaching a screenshot with regex and URI path which does not match

Can you post a screenshot of the rule?

Posting the rule which uses regex that eventually never matches. It’s expected to block bots that tries to access these URLs but I am seeing no matches and bots going through this rule.

This appears to work for me

(http.request.uri.path matches "^/jewellery/.+-[^/]+-.+.html")

Are you sure its matching the right URI path without escaping the forward slashes?

Well, it works for me :wink:

Escaping should not be necessary in this case.

Awesome, working for me too. Thanks man!

This topic was automatically closed after 14 days. New replies are no longer allowed.