I have two regular expressions, for use with Regex.Split
:
(?<=\\G[^,],[^,],)
and
(?<=\\G([^,],){2})
From docs:
If capturing parentheses are used in a Regex.Split expression, any captured text is included in the resulting string array.
You have a capture group in your second expression. Try non-capturing parens:
(?<=\G(?:[^,],){2})
From the documentation for Regex.Split
If capturing parentheses are used in a Regex.Split expression, any captured text is included in the resulting string array.
The internal parentheses are capturing. Try using (?:[^,],)
instead.