description "User defined alias for this entity. Must be an alphanumeric string with dash or underscore"; } }
It looks like the escaped character “\-“ is not liked by the ncsc complier. Here is a list of all the patterns that failed compiling of the YANG. These all pass regex validation but are generating ncsc compiler errors.
On RFC6020 under the quoting section you can read:
A single-quoted string (enclosed within ' ') preserves each character
within the quotes. A single quote character cannot occur in a
single-quoted string, even when preceded by a backslash.
Within a double-quoted string (enclosed within " "), a backslash
character introduces a special character, which depends on the
character that immediately follows the backslash:
\n new line
\t a tab character
\" a double quote
\\ a single backslash
So since you're using double quotes and adding a backslash, yang thinks that you're introducing a special character, but you're not, your backslash is actually an escaping character for the regex.
So, to avoid this kind of issues I would recommend you to use single quoted strings on your patterns, such as the ietf draft rfc6087bis recommends:
A single quoted string SHOULD be used to specify the
pattern, since a double-quoted string can modify the content.