Need regx for converting all the double backslash to single backslash in perl -


i have string below string using regular expression nothing working:

use strict; use warnings; $var ="\\\\abc\\cde\\pqs\\some"; $var1 = s/\\/\/;  $var =~ s/$var/$var1/;  print "$var\n"; 

purpose double backslash need change single backslash.

#!/usr/bin/perl -w use strict; use warnings;  $var ="\\\\abc\\cde\\pqs\\some"; $var =~ s|\\{2}|\\|g;  print "$var\n"; 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -