How to write a Yang pattern statement correctly using the following regex:
([a-zA-Z0-9]|(|)|+|,|-|.|:|=|?|’|"|!|@|#|$|%|^|&|*|_|;|<|>|/|\|||}|{|[|]|`|~| ){1,80}
?
Without quotes: won’t work because there is a ; character
Within single-quote: won’t work because regex contains a ’ character
Within double-quote: won’t work because there are escaped characters other than the allowed ones ( \n, \t, ", \ )
Wow, is that actually an expression you want to use, or some kind of stress-test?
Actually, the character in your regexp is not the ascii single-quote a.k.a. apostrophe that YANG defines for quoting, but Unicode ‘RIGHT SINGLE QUOTATION MARK’ (U+2019), i.e. single-quote should work just fine. But if you really need a single-quote in a string that you would want/need to enclose in single-quotes, you can use the “switch quote and concatenate” trick: