I need to parse a text and check if between all squared brackets is a - and before and after the - must be at least one character.
I tried the following code, but it doesn’t work. The matchcount is to large.
Regex regex = new Regex(@"[\.*-.*]");
MatchCollection matches = regex.Matches(textBox.Text);
SampleText:
Node
(Entity [1-5])
Square brackets mean something special in Regexes, you’ll need to escape them. Additionally, if you want at least one character then you need to use
+rather than*.