If I understand your question correctly, you are looking for groups to capture. I am not familiar with the .net api, but in java it looks something like this:
Pattern pattern = Pattern.compile("command SPEED=(\d+) SIZE=(\d+)");
Matcher matcher = pattern.matcher(inputStr);
if (matcher.find()) {
speed = matcher.group(1);
size = matcher.group(2);
}
There are two capture groups in the above regex pattern, indicated by two brackets. In java, they should be referenced by a number, but in some other languages you can refer to them by name.