in reply to Using a regex to extract a version from a Un*x path

As you asking for a generic solution? There isn't one. For example, you specified that "V2" is not a version when others (example) would consider it a version.

Worry more about the working aspect (at which you succeed) rather than the elegance aspect (which isn't really attainable here).

  • Comment on Re: Using a regex to extract a version from a Un*x path

Replies are listed 'Best First'.
Re^2: Using a regex to extract a version from a Un*x path
by gcmandrake (Novice) on Mar 18, 2010 at 15:57 UTC

    Sadly, you are correct, no generic solution is possible. I'm attempting to work in a flawed system (in which no one can agree on a standard) and I must be backward compatible.

    I probably should have phrased my request differently, to me elegant also means robust.