Top "Backslash" questions

The backslash character \ (not to be confused with slash /) is used in many languages to quote the next character, i.e. to make it lose its special meaning.

Groovy: Replace / in Path with \

How would you replace / with \ in Groovy? So that "//10.1.1.1/temp/test" becomes "\\10.1.1.1\temp\test". "//10.1.1.1/temp/test".replaceAll(/'\\/'/,'\\…

groovy escaping backslash slash
Raw string and regular expression in Python

I have some confusions regarding raw string in the following code: import re text2 = 'Today is 11/27/2012. PyCon starts 3/13/2013.' text2_…

python regex escaping backslash rawstring
How to replace backslash with double backslash?

I'm trying to replace backslashes in my string with two backslashes like so: str.gsub!("\\", "\\\\") But, it doesn't do anything. …

ruby string replace backslash
Changing "/" into "\" in R

I need to change "/" into "\" in my R code. I have something like this: tmp <- paste(getwd(),"tmp.…

r backslash slash
Regex to replace single backslashes, excluding those followed by certain chars

I have a regex expression which removes any backslashes from a string if not followed by one of these characters: \ / …

javascript regex replace backslash
Java: Ignore escape sequences

For my command-line-interfaces it's often nice to have a little ASCII art in the beginning, but those often contain many …

java escaping backslash ascii-art
Include header path change from Windows to Linux

I'm porting an application written in C++ from Windows to Linux. I have a problem with the header files path. …

c++ header include backslash
Why do backslashes disappear when run through echo?

I have code like this, which processes a CSV file: #!/bin/bash while read line do variable=$(echo $line | awk …

bash echo backslash
How to print a string with a backward slash in Ruby

I have a string str = "xyz\123" and I want to print it as is. The IRB is giving me an …

ruby string irb ruby-1.9.2 backslash
Need to select only data that contains backslashes in MySQL

I'm attempting to correct entries in a database that have been double-escaped. I believe magic_quotes was on while mysql_…

mysql backslash