B
Bob
I think this is very simple but I am having difficult doing it. Basically
take a comma separated list:
abc, def, ghi, jk
A list with only one token does not have any commas:
abc
The first letter of each token (abc) must not be a number. I am simply
trying to parse it to get an array of tokens:
abc
def
ghi
jk
....or for the single token one:
abc
I can easily do this with String.Replace and String.Split, but would like to
do this with regular expressions. Yet I cannot seem to get it to work, here
is what I have so far:
String input = "abc, def, ghi, jk";
String pattern = @"^((?<name>\D.*?)(\x2C )?)+?$";
Match match = Regex.Match(input, pattern, RegexOptions.ExplicitCapture);
Any input would be appreciated,
Thanks
take a comma separated list:
abc, def, ghi, jk
A list with only one token does not have any commas:
abc
The first letter of each token (abc) must not be a number. I am simply
trying to parse it to get an array of tokens:
abc
def
ghi
jk
....or for the single token one:
abc
I can easily do this with String.Replace and String.Split, but would like to
do this with regular expressions. Yet I cannot seem to get it to work, here
is what I have so far:
String input = "abc, def, ghi, jk";
String pattern = @"^((?<name>\D.*?)(\x2C )?)+?$";
Match match = Regex.Match(input, pattern, RegexOptions.ExplicitCapture);
Any input would be appreciated,
Thanks