Better Cleanup Policy Examples for Asset Matcher

Does anyone have any good Cleanup policy examples? The documentation takes the simple approach of demonstrating a cleanup policy for a maven repo. The Asset Matcher examples do not make a lot of sense to me. I can’t tell if the asset displayed is the full repo path or just the fully qualified asset. Either way, I can’t get any matching to work in the previewer.

I basically have a raw repo type with assets that are in multiple groups (folders).

I can’t seem to get the pattern to match any of these:

nightly *nightly* /nightly* my-asset-nightly*

I’m obviously missing something simple here, but I’ve looked at the syntax for the Elastic Search Rexexp, as indicated by the docs, and I don’t see why the ‘*’ doesn’t work as expected.

Also, two simple suggestions that would be extremely helpful:

  1. Let me specify a repo to apply the policy to.
  2. Let me specify one or more groups to match for the asset matcher.

The UI references the fact this is a regular expression.

In regular expressions * means 0 or more of the preceding character. Your regular expression must also match the entire asset path.

There are a number of handy websites out there that may be able to help you write a regular expression.

Ah thanks. I was following the docs example, but I missed the significance of the preceding ‘.’
Elastic Search Regexp