Regular expressions in pattern not working as expected

I am using the regex ^[][^0-9,A-F#*.?+%()-]*T?($)?$ in pattern


But when I am giving string “3456” , it is not accepting. This is a valid regular expression as checked online.

This is known issue in openconfig Yang models, which uses non-standard string pattern regular expressions. See for details. It is not clear for how long it is going to take for Google to fix the models, it might not happen at all. Therefore, please use Cisco native models in your application. Another option would be download openconfig models to some directory, manually fix all the pattern definitions and then either use the directory as repository or copy conflicting files to the device repository.

Also, YANG RFC states that W3C Regexs should be used which are diferent from Posix Regexs that OpenConfig modules contain.

Some useful links:

The “pattern” statement:

Link to the W3C recommendation for Regexs:

ygorelik gave some good solutions to this in the mean time.