I hadn't thought it through trying to split on '/'. Interesting. I'll have to see where that goes. Thanks.
Such an amazing bunch of replies. Thanks so much, all answers are very much appreciated.
| [reply] |
I, too, very much like JavaFan's approach of Re: Using a regex to extract a version from a Un*x path. However, since I've already composed this reply, you might as well see it.
To avoid the confusion introduced by the presence of 'V2' in some paths, I depend on the presence of the magical 'V2DepCheck' sub-string. (JavaFan neatly avoids this issue by parsing right-to-left, but the regex approach I use must parse left-to-right.) Many more regexes are defined than in other approaches, but I find that it sometimes pays to be painfully explicit when the problem set is ill-defined and mutable, and maintenance may be an issue.
Code:
Output:
| [reply] [d/l] [select] |