Why this matters

Let’s say you want a Matches condition that picks up “prod”, “PROD”, and “Prod”, so you write ‘Matches: (?i)prod’ and check it in an online regex tester before publishing. It looks fine. Python accepts it, and so does JavaScript. Dimension Studio used to accept it too, and the rule is published.

Then your data stops updating. The new pattern is what’s keeping it from materializing, but nothing tells you that. The rule looks right and the regex looks right, so the path to an answer runs through a support ticket and an engineer tracing the failure back to its source. That can take days, and none of it points you at the one thing you’d need to change.

The engine that runs Matches conditions against your billing data is stricter than the ones you’d naturally test against. It doesn’t support the `(?…)` family at all: inline flags like `(?i)`, non-capturing groups `(?:…)`, lookahead and lookbehind, named groups. Backreferences like `\1` are out too. A pattern can be valid in every tool you’d think to check it in and still be illegal in the one place it has to run.

We weren’t catching that at publish time. The pattern went in clean, the rule went live, and the failure landed somewhere the person who wrote it was never going to look.

What we built

Publishing a definition now checks every Matches pattern against the same engine that will run it. If a pattern can’t run there, the publish fails and the error tells you which pattern is the problem and why.

How it works

The check reads the whole definition, so it finds Matches conditions wherever they are: nested in `And`/`Or` blocks, inside group lists, written as a single string or a list of them.

Regex is still one of the most powerful tools in CostFormation. Environments buried in resource names, tag values that drifted between teams, account aliases nobody ever standardized: Matches is how you pull order out of all of it, and every pattern you’d write for that job works exactly as it did. The only ones this turns away are the ones that were never going to run.

See it in the docs → 

Read about Matches reference →