backslash

What's the Magic Behind Escape(\) Character

How does the C/C++ compiler manipulate the escape character ["\"] in source code? How is compiler grammar written for processing that character? What does the compiler do after encountering that character? ...

Can't Add Slash with .htaccess

I have a site with some html files on it. One of them is contact.html. This is my .htaccess, and I'm having problems where I can address the page with site.com/contact, but not site.com/contact/. (Note ending slash.) What's the fix? RewriteEngine On # If the requested URI does not contain a period in the final path-part RewriteCond %{R...

sh read command eats slashes in input?

Perhaps easiest to explain with an example: $ echo '\&|' \&| $ echo '\&|' | while read in; do echo "$in"; done &| It seems that the "read" command is interpreting the slashes in the input as escapes and is removing them. I need to process a file line by line without changing its contents and I'm not sure how to stop read from being s...

Backslash SelectSingleNode Escape

In Javascript I have an XML DOM. I am trying to select a node within the DOM by using SelectSingleNode. Something like cell.SelectSingleNode(stuff [@attrjunk = 'MATCH']). So what I want to match on has a backslash . What do I replace the MATCH with to match on abc\xyz?? I've tried abc\xyz and abcxyz but neither seems to work unfortu...

Java Regular Expression value.split("\\."), The Forward Slash Dot divides by character?

From what I understand, the backslash dot ("\.") means one character of any character right? So because backslash is an escape it should be backslash backslash dot ("\\.") What does this do to a string. I just saw this in an existing code I am working on. From what I understand it will split the string into individual characters. Why do...

ResourceBundle.getString removed backslash character

I tried to get a resource from a file path from a properties file. Property File: info_path=c:\Info\output Java: String path = ResourceBundle.getBundle("bundle_name").getString("info_path"); Result: C:Infooutput I would need to set the file: info_path=c:\\Info\\output Is this the default behavior? or would it depend on the fil...

RegEx for String.Format

Hiho everyone! :) I have an application, in which the user can insert a string into a textbox, which will be used for a String.Format output later. So the user's input must have a certain format: I would like to replace exactly one placeholder, so the string should be of a form like this: "Text{0}Text". So it has to contain at least on...

Backslash problem with String.replaceAll

I'm trying to convert "\something\" into "\\something\\" using replaceAll, but I keep getting all kinds of errors. I thought this was the solution: theString.replaceAll("\\", "\\\\"); But this gives: Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 ...

Python, removing the \'s before getting them processed

Hello, I'm making a program that asks for a path, and Windows' paths contain backslashes, which can be interpreted as an escape sequence by python if the letter right next is the wrong one. I tried string.replace() but it doesn't work as these backslashes get transformed into escape sequences before having the replace function executed. ...

How to escape single quotes in Flash?

I have a user supplied text and I need to prepend all backslashes and single quotes with a backslash. How to do that? ...

How to append '\\?\' to the front of a file path in Python

I'm trying to work with some long file paths (Windows) in Python and have come across some problems. After reading the question here, it looks as though I need to append '\\?\' to the front of my long file paths in order to use them with os.stat(filepath). The problem I'm having is that I can't create a string in Python that ends in a ...

PHP : Document root directory backslash problem.

Hi. I'm trying to link to a stylesheet in my header file using $_SERVER["DOCUMENT_ROOT"] as follows: <head> <?php print "<link href='".$_SERVER["DOCUMENT_ROOT"]."/include/style.css' rel='stylesheet' type='text/css' />"; ?> <title>eLMS</title> </head> Since i'm testing locally, i'm getting the path as: <head> ...

How to print out a backslash in LaTeX

Hi, I want to write a backslash character to a text file using LaTeX. The first line of code below declares a variable 'file' which describes the file 'myfile.out'. The second line opens the file and the third one tries do write a backslash '\' to the file. \documentclass{article} \begin{document} \newwrite\file% \immediate\open...

Add backslash to String in Objective-c

I have a problem identical to this problem here. I even want to encode the same infromation as him (it's a date/time for asp.net)... When ever I try to add a backslash i get two backslashes since I used \. Everyone in the thread above has claimed that this is a problem with NSLog and that NSString does tread \\ as a \. I have checked ...

How to tell if my YEN symbol is a backslash or a YEN?

Hi, all, I have a little program which is used to print the backslash symbol to the PDF file. In most English OS a backslash is displayed as a backslash, and my program works just fine. However, in Japanese OS or Korean OS my program starts to have problem. In those OS, a backslash is displayed as a YEN or WON symbol, but my program ex...

R slash - escape oder sanatize using regex?

Hi there I've just started analyzing some data using R - unfortunately I have encountered some problem... I'm reading in a (tab separted) csv file and want to process the data and there is one attribute I am particularly interested (which certainly exists within this csv). This is called: data_transfer.Jingle/TCP.total_size_kb Now when ...

Prevent backslash from being parsed by javascript for a string

A Flash AS3 IRC application sends me a string like "f\reak" to my javascript. Irc allows the \ in usernames which poses a problem when its passed to javascript. "f\reak" become "feak" in javascript making the \r into a carriage return. Is there a way to read the absolute value of the string instead of parsing a carriage return? These don...

Javascript and backslashes replace

here is my string: var str = "This is my \string"; This is my code: var replaced = str.replace("/\\/", "\\\\"); I can't get my output to be: "This is my \\string" I have tried every combination I can think of for the regular expression and the replacement value. Any help is appreciated! ...

Replacing backslash with another symbol in PHP

Hi there, Been struggling with replacing a backslash by another symbol such as '.-.' just to indicate the position of backslashes as I could not send a string such as 'C\xampp\etc.' through url as GET variable so I thought I'd first replace the backslashes in that string by another symbol, then send through url, and then replace them ba...

Ruby -- looking for some sort of "Regexp unescape" method

I have a bunch of string with special escape codes that I want to store unescaped- eg, the interpreter shows "\\014\"\\000\"\\016smoothing\"\\011mean\"\\022color\"\\011zero@\\016" but I want it to show (when inspected) as "\014\"\000\"\016smoothing\"\011mean\"\022color\"\011zero@\016" What's the method to unescape them? I imagine that ...