Is currently yielding versions 3.0-RC1 and 3.0-RC before 3.0. That's wrong in most cases, release candidates, alfas, betas, or alike come before 3.0.
I'm not sure if the sorting criterion can be generalised into x.y?* < x.y, unless ? is '.'
An alternative could be that certain patterns are considered pre-release postfixes. Another alternative might be an API parameter to filter results by regex (which, of course, I can apply after the API call, but having it straight in the API would make things easier). Or is the latter already available?