I am adding a regular expression that uses assertions (look ahead) in the pattern field for an entity. However, when I try to compile the file, I get a bad pattern error.
I could not find details on whether assertions are allowed in YANG model or not. below is an example -
…
type string{
pattern: '(?=.*[a-z])(?=.*[A-Z])';
}
…
Correct. RFC 6020 YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF) state that the regular expressions supported by YANG is specified in XML Schema Part 2: Datatypes Second Edition.
In Appendix F in the linked document you can read about the features supported by the YANG regex engine, assertions including lookahead and loosbehind is not supported.