Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple substitution

Status
Not open for further replies.

kirk124

Programmer
Apr 15, 2003
26
US
Hi,

How can I do a substitution to change "c:\tmp/sup" to "c:\\tmp\\sup".

I tried s/\/|\\/\\\\/ but it did not work.

--thanks
 
Instead of using escaped \ ie \\, just use /

HTH
Paul
 
try using a character class in the substitution instead of '|':
Code:
s#[/\\]#\\\\#g;

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top