I have some text like
The quick brown [fox] jumps over the lazy [dog]
If I use the regex
\[(.*?)\]
I get matches as
fox
dog
I am looking for a regex which works even when one of the braces are missing.
For example, if I have text like this
The quick brown [fox jumps over the lazy [dog]
I want the matches to return "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 "fox"
The text can have multiple matches and multiple braces can be missing too :(.
I can also use C# to do substring of the results I get from regex matches.