Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: How do I change .. to the real filename?

by Shakya (Initiate)
on Oct 06, 2007 at 18:59 UTC ( #643140=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I change .. to the real filename? - Answer contributed by Shakya

You can even try this -
1 while ($string =~ s!(/(?:[^/.]+/)*)((?:[^/.]+/)+\.\./?)(.*)$!$1$3!g) +;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2017-01-18 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (161 votes). Check out past polls.