Let's decode the RE \[[^\]]*\]
\[- Literal[character[^\]][^\]- Neither aNot\nor]- Literal]character*- Previous item repeated zero or more items, i.e.]zero or more times\]- LiteralAnother literal]character (the backslash is ignored here)
Applying this to [ A ] we can see it will not match. I suspect the question you're asking is why [^\]] does what it does. The ^ negation symbol has a special case that when the next symbol is ] it's to be treated as a literal. Unless you prefix it withliterally, otherwise it's always the end of the \[...] in which case literal-vs-RE is reversed. This is what you've hitconstruct.
Instead you could use this RE, \[[^]*] or even anchor the front and back of the string, ^\[.*]$