I am looking for a regex rule to match everything inside square brackets, including the brackets and ignoring the possible brackets inside. E.g. from:
[value] in the [text[42]] and [1[2[3]]]!
I need to extract [value], [text[42]] and [1[2[3]]].
I use
\[(.*?)\]
Here are more expamples - https://regex101.com/r/Xp4ghi/1
P.S. I am going to use it in .NET