I need to parse the below string, and want to use regular expression but can figure the correct way to do it.
Input Sample (token separator is ; and inside the token is any Char i.e. M/W/D )
1W4;2W35;4M35;13W108
Expected output
List<string> points = new List<string>() {"1W", "2W", "4M", "13W"};
List<int> intervals = new List<int>() {4, 35, 35, 108};
Thanks for any help.
You could just split your string on tokens by using
string.Splitand then parse each token using regex: