So if I have these lines:
test 1
[test 2]
[test] 3
test [4]
[test][5]
[te]st[6]
I would like only the 2nd and 5th lines to be matched ([test 2], [test][5]).
I know that we can match what's inside a pair of square brackets with regex
\[.*?\]
But how do we deal with multiple pairs and how to tell it to not match the line if there's anything outside of the square brackets?
Thanks