string sentence = "X10 cats, Y20 dogs, 40 fish and 1 programmer.";
string[] digits = Regex.Split (sentence, @"\D+");
for this code i get values in digits array like this 10,20,40,1
string sentence = "X10.4 cats, Y20.5 dogs, 40 fish and 1 programmer.";
string[] digits = Regex.Split (sentence, @"\D+");
for this code i get values in digits array like this 10,4,20,5,40,1
but i like to get like this 10.4,20.5,40,1 in decimal numbers how can i do this.