Cloudflare has reported an upgrade to their Ruleset Engine that previously lacked the ability to perform globbing pattern matching, resulting in limited rule writing capabilities. Despite the addition of other features, they ultimately had to create their own library named wildcard.
Globbing pattern matching is widely used, such as displaying files based on specific file extensions like .jpg. However, Ruleset Engine usage is more complex than simply checking if text matches the specified pattern, as it involves transforming matching text, like redirecting to other servers using the original URL.
Cloudflare attempted to utilize existing libraries, but the regex module proved too intricate for their needs, requiring caution when handling unnecessary special characters. This added unnecessary complexity, whereas the wildmatch module almost met their requirements, except for requiring input as a string while Cloudflare’s URL data is in byte arrays, making string substitution impossible.
The wildcard_replace function has now been released to all platforms.
Source: Cloudflare Blog
TLDR: Cloudflare upgraded their Ruleset Engine to enable globbing pattern matching, improving rule writing capabilities and streamlining complex tasks with their wildcard library.
Leave a Comment