I've a log line as follows:
[2021-03-10 00:13:32.901] [DefaultDispatcher-worker-2 @coroutine#3] [DEBUG] [4231c006d9083a302fce59d5f0957226] [42c5ac3c0acfc68d] [GreeterImpl] Hello John
It's 6 blocks of text within [] and then the rest. I'm looking for a regex to extract the text within [], and also at the end. A text block within [] can be empty.
I tried (?:\[([^\[\]]*)\])+([^\[\]]+) but it only matches the first block in []. I've also tried (?:(?<=\[)[^\[\]]*(?=\]))+([^\[\]]+) but that doesn't match anything.
FWIW, the regex will be implemented in Java.