Implement a regex pattern

I need to implement a regex pattern of [a-zA-Z0-9/._-][^\] in my yang model.
When I try:

typedef test {
type string {
pattern ‘[a-zA-Z0-9/._-][^\]’;
}
}

When I try this out, my cli accepts all values and doesnt apply the pattern. What do I need to do to apply this pattern in my yang model

Try to commit and see if validation happens at commit time.

https://yangcatalog.org/yangre/
Perhaps you intended to put a \\ at the end?