] should be placed directly after ^ ! Hence, [^][,] is correct; while [^[,]] is incorrect.
]
^
[^][,]
[^[,]]