I have text like
The quick brown [fox] jumps over the lazy [dog]
If I use regex
\[(.*?)\]
I get matches like
fox
dog
I am looking for a regex that works even if one of the curly braces is missing.
For example, if I have text like this
The quick brown [fox jumps over the lazy [dog]
I want the matches to return the "dog"
Update: Another example if I have text like this
The quick brown [fox] jumps over the lazy dog]
I want the matches to return the "fox"
The text may contain several matches, and also several curly brackets may be absent: (.
I can also use C # to substring the results obtained from regular expression matches.