I have this string
blabla [IC=\"test\"]Hello, [IC=\"testing\"] this is a nested tag [EC], cya.[EC] blabla
I\'m trying to match the outer [
[
The regular expression below should do the trick:
[^\[]*(\[.*\])[^\]]*
You can try a working demo visiting this link.
Alternatively, if you don't want to rely on capturing groups, this should be enough:
(\[.*\])
A working demo of the regular expression above can be tested here.