用于选择仅具有外支撑的内支撑的正则表达式

This is the text

[Interim Review[s]] are g[iv]en [by m[a]in head] and [no one e[lse has] th]e access

The regex must be in the format

[Interim Review[s]] are g[iv]en [by m[a]in head] and [no one e[lse has] th]e access

You can see that the inner brace which is having outer brace must be highlighted. The one which has only a single brace without outer brace must not be highlighted. You can see in the format given in the question that in g[iv]en [iv] must not be highlighted as it does not have an outer brace. But in [Interim Review[s]], [s] must be highlighted and in [by m[a]in head], [a] must be highlighted and in [no one e[lse has], [lse has] must be highlighted.

I have tried the regex [[^[]]*], you can see in https://regex101.com/r/xR0wM3/5, but it is selecting the brace which does not have outer brace also. Which is not the required output

 \[[^[\]]*\](?=[^\[]*\])

Add a lookahead to ensure that.See demo.

https://regex101.com/r/xR0wM3/8

you can try this out \[[^\[]+?]

You may want to use a capturing group:

\[[^\[\]]*(\[[^\[\]]*\])[^\[\]]*\]