"Richard S. Hall" <[EMAIL PROTECTED]> writes: > I won't claim to completely understand the regex, but looking at this > is it completely correct?
Apparently not. > The OSGi version must "<number>.<number>.<number>.<qualifier>". I took all but the first number to be optional, but you're right, my regex would cause problems due to missing minor or micro number components. > Is this just replacing the first "-" to a "."? Naively, yes, the first "-" following a number that either starts the string or follows a dot. > If so, it won't be correct either, since "1.0-foo" would be > converted to "1.0.foo", instead of "1.0.0.foo"... Yes, I missed the part about needing to fill in the missing numbers before placing the qualifier. To do that, we'd need several more capture groups, and we'd need to count how many groups had been populated to figure out how many numbers are missing. That will take longer than the five minutes I spent on my first pass. -- Steven E. Harris