Captures are different from groups.
matchResults.Groups[0]
always coincides with everything. So your group would be
matchResults.Groups[1],
if the regular expression was "(a)" . Now, since it is "(?:a)" , you can verify that it is empty.
Captures are a separate thing - they allow you to do something like this:
If you have the regular expression "(.)+" , Then it will match the string "abc" .
Group [1] will then be “c,” because this is the last group, and
- Groups [1]. Captures [0] is "a"
- Groups [1]. Grips [1] - "b"
- Groups [1]. Captures [2] is the "c".
source share