Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Re: Re: search =~ for /'s

by screamingeagle (Curate)
on Jun 30, 2002 at 02:42 UTC ( #178298=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: search =~ for /'s
in thread search =~ for /'s

since file url's (like file://c:\test) also work with forward slashses instead of backslashes (file://c:/test/), how about simply replacing all backslashes with a forward slash, and then use the same regex that has been provided by caedes:

$new =~ s/\\/\//g; $new =~ s/([^\/])$/$1\//;

Comment on Re: Re: Re: search =~ for /'s
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://178298]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2015-11-24 22:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (664 votes), past polls