[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Perl Regular Expression

Have a Tk function that lets a user select a file. Its returning the a path format that will not work in windows/perl for my program. I need to take the path I'm getting back and reformat it. So any / are replaced with \\

How its returned to me: R:/Project 2/Project 2.rqs
How I need it to be: R:\\Project\\Project 2.rqs
0
KGNickl
Asked:
KGNickl
2 Solutions
 
farzanjCommented:
Suppose it is sorted in variable $url, then perl RE would be
$url =~ s/\//\\\\/g;
0
 
jeromeeCommented:
or  $url =~ s:/:\\\\:g;
0
 
KGNicklAuthor Commented:
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now