This could be simpler if you know the numbers are unsigned integers and there is only one number in the string. This example assumes there isn't any scientific notation but there might be commas between numbers. It also assumes there are no numbers in a unit, like sec^2. the regex function is used to remove all the characters that are not (the ^ is "not") in the set 0-9, minus, period, and comma. the backslash before the minus is an escape to make not be part of a range. The "" is the replacement value for each character not in the set (deleting them). The words function turns the result into a list of strings using the comma as a delimiter.