escaped-characters

Using escape characters inside grep

I have the following regular expression for eliminating spaces, tabs, and new lines: [^ \n\t] However, I want to expand this for certain additional characters, such as > and <. I tried [^ \n\t<>], which works well for now, but I want the expression to not match if the < or > is preceded by a \. I tried [^ \n\t[^\]<[^\]>], but this did...

How to use escape character in replace function when replacing semi-colon in VB

Okay so I was helped earlier with my program question and found out that """" is how you make " become another variable in the function: Robert = Replace(Robert.ToLower, """", "A") So now I am also trying to work with other keys like the semi-colon. I put it in the function like this: Robert = Replace(Robert.ToLower, "char(59)", "B")...

Filesystem filename escape? C#

I am allowing the user to choose any username he wants and it can be anything at all such as AC♀¿!$"Man'@ Now i need to create a directory for him. What function i use to escape the text so i dont a FS problem/exception? ...

SQL Escape ' '

Hi I am trying to run a query in SQL 2008 by doing: @query varchar(max) SET @query = 'SELECT * FROM Table WHERE [Name] = ' 'Karl' ' ' EXEC(@query) The problem is that for some reason the apostrophes around 'Karl' don't get escaped, i.e. the query executes as ...WHERE [Name] = Karl and fails. Anyone have a suggestion? Thanks Karl...

Odd batch escape character problem

I'm trying to execute this mysql command from a batch file: mysql -f -utest -ppass db < alter1.sql However, < is an escape character. I tried nesting it in double-quotes, but the double quotes end up appearing as part of the command. I even put a carrot (^) in front of it, LOOKS fine in the prompt window, but mysql still gets that ^ ...

Where can I get a list of the XML document escape characters?

Where can I get a list of the XML document escape characters? ...

Fastest quote-escaping implementation?

I'm working on some code that is normalizing a lot of data. At the end of processing, a number of key="value" pairs is written out to a file. The "value" part could be anything, so at the point of output the values must have any embedded quotes escaped as \". Right now, I'm using the following: outstream << boost::regex_replace(src, ...

Is there a special meaning of "\h"?

Hey, Does \h have some special meaning? I store the username in a hidden field in my HTML, and all usernames works, but mine (which is DOMAIN\hers....) fails, it ends up like "DOMAINhers...) when picked up by Javascript (JQuery). Any ideas? ...

Escaping ampersands inputted by users through text fields?

Like almost all apps today, I have users who enter various information through standard text inputs. My app is running on Rails. It's a no-brainer to escape ampersands that I include as part of the site copy, etc. But how do I escape an ampersand that is dynamically inputted by a user? Currently, it's totally breaking my frontend...

Escaping Apostrophes Input by Users Through Text Fields in a Rails App?

Update: If you look at the javascript code that I pasted in the update below, I have single quotes around the variety.name variable. I think I was just following a tutorial in doing that. Turns out that when I switch those to double quotes, everything works fine. Question: Is this a stable solution? Or would it still be better to imp...

How can I suppress \\ in my output from Perl's JSON module?

Following code always print paths with double slashes: use JSON; use File::Spec; my $installdir = $ENV{"ProgramFiles"}; my $xptrlc = File::Spec->catfile($installdir,"bin","sample"); my $jobhash; my $return_packet; $jobhash->{'PATH'} = $xptrlc; $return_packet->{'JOB'} = $jobhash; my $js = new JSON; my $str = $js->objToJson($return_p...

How can I stop jQuery from unescaping my accented characters?

Some non-ascii characters get escaped in most html documents. Like this: text: "därför" html: "d&auml;rf&ouml;r" If I view source I can see that I have the html version on my page. I'd like to retrieve that with jquery but both text() and html() unescape it and give me back the text version. I'm buried in umlauts and thirsty for ...

Get str repr with double quotes Python

I'm using a small Python script to generate some binary data that will be used in a C header. This data should be declared as a char[], and it will be nice if it could be encoded as a string (with the pertinent escape sequences when they are not in the range of ASCII printable chars) to keep the header more compact than with a decimal o...

How do I escape the # character in a VB.NET string literal?

If I needed to escape a double quote character within a string literal I'd use two consecutive double quotes as follows: Dim name = "Chuck ""Iceman"" Liddell" However, it doesn't seem like consecutive # works the same way. The compiler is expecting a compiler directive to follow the # character, even when its enclosed in double quote...

Javascript escape quotes

This is so stupid, but I can NOT figure this one out. I'm outputting values from a database (it isn't really open to public entry, but it is open to entry by a user at the company -- meaning, I'm not worried about XSS.) I'm trying to output a tag like this: <a href="" onclick="DoEdit('DESCRIPTION');">Click Me</a> DESCRIPTION is actu...

Escaping html in Jquery

I have a simple jquery snippet here: $("#someid").html("Text Here"); The only problem I am having is that I am putting Database data inside the html(). $("#someid").html("<?php echo $row['tablecolumn']; ?>"); It works great! Except for one thing. It does not show when I have 'breaks' in the text from the database. I'm sure I need...

How can I prevent Perl from interpreting \ as an escape character?

How can I print a address string without making Perl take the slashes as escape characters? I don't want to alter the string by adding more escape characters also. ...

decoding base64 encoded string with URL escaped characters

I am currently working on importing contacts from windows live contacts(hotmail addressbook). At one stage, the service posts back some data that i need to my page as a base64 encoded string which, as per microsoft documentation, contains url escaped sequences for '&' and '='. The string is thus not standard base64 encoded. The problem ...

Can all keys be represented as a single char in c++?

I've searched around and I can't seem to find a way to represent arrow keys or the escape key as single char in c++. Is this even possible? I would expect that it would be similar to \t or \n for tab and new line respectively. Whenever I search for escaped characters, there's only ever a list of five or six well known characters. ...

How do i escape invalid characters in filenames on multiple FS

How do i escape invalid characters in filenames? I ask this question once before and wrote up a class with the solution. Now i would like to extend it. My site will be able to detect what OS the user is on. So base on that i either 1) Want to escape based on the FS/OS the user is on or 2) Escape it so it works on all filesystems. What c...