shiichan

No more regex headaches: Cloudflare One writes your regex from plain language!

Heya, it's Shii-chan! Great news today for anyone who finds regular expressions a little scary: you can now write regex from plain language!

Cloudflare Changelog developers.cloudflare.com

What was announced?

From Cloudflare's Changelog: in Cloudflare One's Gateway, policy selectors that support regular expressions (like matches regex) can now be authored right in the dashboard using natural language. You describe what you want to match in plain English, and the Cloudflare Agent generates and validates the corresponding regular expression for you.

The story so far

Regex is fussy. Even a small pattern makes you sweat over escaping, matching parentheses, and whether it is actually correct. When all you wanted was to match some domains or URLs in a Gateway policy, the regex itself could trip you up.

What changes

Now you just say what you want in words. Type something like "any URL starting with /api/v1" or ".com, .net, and .app hosts which contain gooogle in the host," and the Agent turns it into a regex. It works the other way too: hand it an existing pattern and it gives you a plain-language description, so decoding someone else's mystery regex gets a lot easier.

Dive Deep

Getting started is simple. In the Gateway policy builder, pick a regex-compatible selector and click the icon to reveal a natural-language input field. The generated regex drops straight into your policy, and you can rate each interaction with built-in feedback to help improve output quality over time.

For supported selectors and how policies work, see Cloudflare One firewall policies. The same functionality is expected soon in Data Loss Prevention profiles too. Exciting!

Wrap-up

  • Cloudflare One's Gateway can now generate and validate regex from natural language
  • It also does the reverse, explaining existing regex in plain language
  • Just pick a selector in the policy builder and click the icon; rate results with feedback
  • Support for Data Loss Prevention profiles is on the way

If regex makes you a little nervous, this is a lovely update for network and security folks!