I need to find a regular expression for use in C# (JavaScript as well), for get the text inside the either square brackets combination.
I try several ways, but I give up
If you prefer to use a regular expression, the following will work.
\[([^[\]]+)\]
See Live Demo
Consider replacing those characters instead of trying to match between them.
String input = @"[[[text]]]]]]]]]]]]]";
String output = Regex.Replace(input, @"[[\]]", "");
Console.WriteLine(output); //=> "text"