note
jaldhar
<p>Thanks for the tip. I found slightly more understandable code in [cpan://File::Spec] which has resulted in the following regexps:
for Unix...
<code>
qr{(\A (?: .* / (?: \.\.?\z )? )? [^/]* )}msx;
</code>
...and Windows (includes UNC paths)...
<code>
qr{(\A
(?:
[a-zA-Z]:
|
(?:\\\\\\\\|//)[^\\\\/]+[\\\\/][^\\\\/]+
)?
(?:.*[\\/](?:\.\.?\Z(?!\n))?)?
.*
)}msx;
</code>
</p>
<div class="pmsig"><div class="pmsig-25823">
<p>-- <br>જલધર</p>
</div></div>
734802
734842