You might also find this interesting: Ordered Comparison of Generalized Version Strings.. I think this will do exactly what you want, already. The thread discusses other ways of comparing multi-part strings, too. Something there should be useful to you.