CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [triveni1125] Forward slash to backward slash and strip off y:: Edit Log



toolic
User

Dec 24, 2009, 10:16 AM


Views: 4174
Re: [triveni1125] Forward slash to backward slash and strip off y:

\ is special, and it needs to be escaped: \\


Code
use strict; 
use warnings;

my $str = 'Y:\default\main\safari\Airline\WORKAREA\Workarea01/html/jetnet/china.html';
$str =~ s/^Y://;
$str =~ s{\\}{/}g;
print "$str\n";



(This post was edited by toolic on Dec 24, 2009, 10:18 AM)


Edit Log:
Post edited by toolic (User) on Dec 24, 2009, 10:18 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives