in reply to Re: Absolute pathnames from relative?
in thread Absolute pathnames from relative?
(s{/[^/]*/+\.{2}/}{/}g;
(Update: never mind what I said about positive-lookahead. There seems to be no way to avoid using a loop to make this "work", so no point using "(?=/)" as the last part of the match. This was never intended as a serious solution anyway, given the issues discussed in other replies.)
|
|---|