On 19. 10. 21 9:06, Jan Lindblad wrote:
Hi Balazs,
And don't forget that in YANG 1.1 you can exclude characters.
type string {
pattern ".*\n.*" { modifier invert-match; } // Disallow newline characters
pattern ".*\r.*" { modifier invert-match; } // Disallow carriage return
characters
}
It is also worth noting that in fact (sec. 9.4 in RFC 7950) "The string
built-in type represents human-readable strings in YANG." This may
possibly be what Balazs wants, although I doubt that there is an
implementation that can really *print* all such strings.
Lada
/jan
On 18 Oct 2021, at 13:24, Ladislav Lhotka <[email protected]> wrote:
Hi Balazs,
Unicode (if you mean it) is so convoluted that the notion of printable/visible
characters doesn't make much sense. It is IMO much safer to specify character
classes that you want to permit.
Lada
On 18. 10. 21 12:11, Balázs Lengyel wrote:
Hello,
Is there a way in YANG to restrict a string to printable or visible characters?
(Something like SNMP DisplayString)
Regards Balazs
--
Balazs Lengyel Senior Specialist
Ericsson Hungary Ltd.
Mobile: +36-70-330-7909 email: [email protected]
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod
--
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod
--
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod