I have many patterns with bracket enclosure, I made a regular expression where is not considering brackets and just only what is inside/between them, but exists a problem when the text within brackets contain [] brackets too.
Thanks!
Regex: (?<inside_value>(?<=\[).*?\[?(?=\]))
For example,
A) [ClusterReceiver[99] ]
B) [first-second-third-8050-exec-a ]
From above, B) is working perfectly, but A) not
What is being returned for every case (without quotes):
B) "first-second-third-8050-exec-a "
A) "ClusterReceiver[99"
What is desired?
B) "first-second-third-8050-exec-a "
A) "ClusterReceiver[99]"
The problem is when exist [ ]
bracket enclosure within outer [ ]
enclosure.
The worst case is when exists that problem like A), can you help me by giving a suggestion how to accept at least 1 bracket, in order to have A) as desired "ClusterReceiver[99]" ?