I have some strings that contain numbers (sometimes) like
1 teaspoon garlic
1/2 cup of butter
1 1/2 ounce yogurt
I'm trying to parse out the numerical part(including the fractions). So
1 teaspoon garlic = "1"
1/2 cup of butter = "1/2"
1 1/2 ounce yogurt = "1 1/2"
I have some regex that I thought was correct that looks like
Regex re = new Regex(@"^\(\d+(\d*|\s\d+\/\d+)\)$");
var match = re.Match(input);
Doesn't seem to be working though. How I can parse out the matching regex from a string?