Well, I think there are two distinct problems:
1. Admit spaces only in middle of numeric version and only in interval.
In my opinion if '3.0.2-3.0. 3' is correct, these should be correct:
'3.0. 3' (space in numeric version without interval)
'3.0 RC1' (space in no-numeric version)
I think it is a bug. If admit spaces in the middle of numeric version in interval, should admit spaces in the middle on all type of version.
For this, source code is the same of above but replace
$version = strtr($version, array(' ' => ''));by
$versions = strtr($versions, array(' ' => ''));
(When I write this PHP code I can not write correct regular expression because failure to save. I write SPACES instead of [[:blank:] ], without space character between "]")
$regex = array('SPACES*,SPACES*' => ',', 'SPACES*-SPACES*' => '-', 'SPACES*\.SPACES*' => '.', 'SPACES+' => ' ');
foreach ($regex as $pattern => $replacement)
$version = ereg_replace($pattern, $replacement, $version);
$versions = ereg_replace($pattern, $replacement, $versions);
2. No spaces where there should be.
This is case of 3.0RC1 (correct is 3.0 RC1) or 3.0Beta (correct is 3.0 Beta).
This is a bogus bug and with source code of case 1 not is allowed.
I rewrote my first post to correct only the case 1. I hope that is correct ;)