Examples for rules with regular expressions
Matching regular expressions is a powerful functionality to add virtual machines (VMs) to Avamar or backup policy automatically.
About this task
Below example explains how to configure the rules with regular expressions.
Description | Examples | Expression |
---|---|---|
Match the VMs that start with "vm". | "vm1" or "vm2" | ^vm.* |
Match VMs which do not start with "vm". | "my-vm1" or "my-vm2" | ^(?!vm).* |
Match VMs which end with "vm". | "my-vm1" | .*vm$ |
Match VMs that do not end with "vm". | "my-vm1" | .*(?<!vm)$ |
Match VMs that contain "vm" (case insensitive) in upper or lower cases. | "VM1" or "vm1" | .*(?i)vm.* |
Match VMs that contain "vm" or Linux. | "vm1", "Linux1" | .*(vm|Linux).* |
Match VMs that contain "vm" with at least two digits. | "vm01","vm02" | .*vm(\d){2,} |
Match VMs contain:
| "vm1","vm2" | ^[a-zA-Z]{2,5}(\d)+$ |
Match VMs which do not contain white space. | ^\S+$ | |
Match VMs contain at least one space in the middle. | ^\w+\s+\w+$ |