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...
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")...
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?
...
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...
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?
...
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, ...
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?
...
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...
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...
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...
Some non-ascii characters get escaped in most html documents. Like this:
text: "därför"
html: "därfö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 ...
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...
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...
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...
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 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.
...
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 ...
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? 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...