I would like define a string pattern that doesn’t include a substring “last-as”.
leaf test2 {
tailf:cli-multi-value;
type string {
pattern ‘^(?!.last-as).’;
}
}
I have got the following when compile
error: invalid pattern: “Bad Pattern”
looks like negative lockahead ?! is not working for yang.
please help.
This allows any string value consisting of alphanumeric characters plus '-' and '_' that does not include the string "last-as". Note that the modifier statement requires that you use yang-version 1.1.