With the following regular expression:
InitValue\((\w*)\)
and the test string:
InitValue(Input1)
I get the following result:
Full match: InitValue(Input1)
Group1: Input1
With the following regular expression:
InitValue\((\w*)\s*,\s*(\w*)\)
and the test string:
InitValue(Input1, Input2)
I get:
Full match: InitValue(Input1, Input2)
Group1: Input1
Group2: Input2
Now I would like to capture any number of arguments to the InitValue-method. The number of arguments to InitValue are unknown.
Full match: InitValue(Input1, Input2, ..., Inputn)
Group1: Input1
Group2: Input2
....
Groupn: Inputn
Of course I can't repeat the following pattern in my regular expression since I don't know the number of arguments in advance:
\s*,\s*(\w*)
How do I write a regular expression which outputs n number of capture groups?
I use the regular expression in C#-code (Regex, Match)...