A have a string that matches the format [abc][def][ghi][jkl]. I am using the following expression to parse the string
expression = @"\[([\s\S]*?)\]";
In this case, I can see that the groups created are
1: abc
1: def
1: ghi
1: jkl
The issue is that when I loop through the MatchCollection and check the match.Value it gives me the entire item which includes the braces (i.e. collection[0].Value = [abc]).
How do I return only what is shown above in the created groups?
Thanks
What you want is the
Groupsattribute.collection[0].Groups[1],collection[1].Groups[1], etc, is the portion of the string which matched group 1.