New String & Regex Values


Check NetApp-REST introduces a breaking change beginning with v3.0.0.


For parameters that previously expected a regular expression: Beginning with the v3.0.0 release, values which do not start with a tilde (~) are interpreted as strings that must match exactly, and not as regex patterns.


The new notation is more intuitive, as the former could lead to false negatives, as shown in this example:
The option ‑‑exclude=vol1 also excluded vol10 or vol11 or even somevol123. Now, with the new notation, it does exactly what you would expect at first glance: it only excludes vol1.

The new interpretation in a nutshell:

  • If the value begins with a tilde (~), everything after the tilde is interpreted as regular expression. E.g. ‑‑exclude=~aggr0 excludes every aggregate whose name contains aggr0 in the name.
  • If the value does not begin with a tilde, it is interpreted as a string that must match exactly. For example, ‑‑exclude=aggr0 will only exclude the aggregate whose name is exactly aggr0.

Existing Configurations

This change may require adjustments to your existing configuration files if they contain options such as ‑‑exclude, ‑X, ‑‑include, ‑I, ‑‑ok-value, ‑‑ok-state or similar.

Typical changes are:

  • Anchored values like ‑‑exclude=^vol0$ must be changed to ‑‑exclude=vol0.
  • Patterns like ‑‑ok‑status=^(online|mixed)$ must be changed to ‑‑ok‑status=~^(online|mixed)$ (add a tilde in front of the value).

Further Reading

Further details and examples on this topic are on our page Regular Expressions


We will be happy to hear your thoughts

Leave a reply

Som2ny Network