w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
SQL Server Management Studio replacing single quotes with double quotes when modifying stored procedure
I believe you are getting dynamic SQL from the scripting options because you have this option selected: Tools > Options > SQL Server Object Explorer > Scripting > Check for object existence When this setting is enabled, the script is generated like this: IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = ...) BEGIN EXEC dbo.sp_executesql @statement = N'ALTER PROCEDURE...' END Disable this option, and it should be correct when you use right-click > Modify or right-click > Script stored procedure as > ALTER to >.

Categories : Sql Server

Single quotes, double quotes and passwords containing $ in Windows and Unix
You can dump from within a pdo PHP script : <?php $dumpSettings = array( 'include-tables' => array('table1', 'table2'), 'exclude-tables' => array('table3', 'table4'), 'compress' => CompressMethod::GZIP, /* CompressMethod::[GZIP, BZIP2, NONE] */ 'no-data' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-data */ 'add-drop-table' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-table */ 'single-transaction' => true, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction */ 'lock-tables' => false, /* http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables */ 'add-l

Categories : Windows

Vim: Put newlines around '{' and '}' but not around those inside strings with single quotes or double quotes
One suggestion perhaps, without posting vimscript (though I cannot think of a regex that will do this in one pass) is to decide upon some marker scheme (I prefer 3 hashes) and do it in stages. I will be back later with the correct regex (the commands I'm familiar with are not working so well on my windows gvim install) Step 1: With a regex that searches for anything of the form .*["||'].*{.*}.*["||'] (i.e. braces inside quotes) prepend matching lines with your marker Step 2: Now with a regex search for any lines that match something like: ^[^###]+.*{.*} (i.e. anything with braces and the line not beginning with markers) and put in your returns Step 3: remove the markers

Categories : PHP

Why do I have to escape double quotes in my string surrounded by single quotes?
Looks like you are missing semicolon ; at the end of your variable assignment. It should be: $weapon_secondary = '<select name="weapon" class="dropdown"> <option>Option 1</option> <option>Option 2</option> </select>'; As an alternative you can use heredoc to declare a variable and avoid this quoting exercise: $weapon_secondary <<< EOF <select name="weapon" class="dropdown"> <option>Option 1</option> <option>Option 2</option> </select> EOF;

Categories : PHP

Double quotes inside single quotes in oracle statement
I don't think the problem comes from your column name, as shown in this working example: SQL> CREATE TABLE trytable (ID VARCHAR2(10), "DEFAULT" NUMBER); Table created SQL> BEGIN 2 EXECUTE IMMEDIATE 3 'INSERT INTO trytable (ID, "DEFAULT") VALUES (''monkey1'', 0)'; 4 END; 5 / PL/SQL procedure successfully completed Technically, you can have a table column name named DEFAULT, even if it's generally a bad idea that will lead to confusion. You will only be able to interact with it through the double-quote " syntax because DEFAULT is a reserved word. If you specify double quotes around identifiers, Oracle will treat them as case-sensitive, so you have to make sure that they match the table specs. In your case, it would help to have the specific error message.

Categories : Oracle

Best Way to escaping single quotes and double quotes in a string
you should use fn:escapeXml() because It escapes quotes and also other characters that could be interpreted as XML markup. . It also helps in prevention of XSS attack in JSP.

Categories : String

PHP Replace attribute single quotes with double quotes
I realized that PHP's DOMDocument class does this automatically... libxml_use_internal_errors(true); //use this to prevent warning messages from displaying because of the bad HTML $html = new DOMDocument();//'1.0','UTF-8' $html->xmlStandalone = false; $html->loadHTML($b); $b = $html->saveXML();

Categories : PHP

php - the single quotes mixture with the double quotes use
Possibly just an error in the question, but this line has 2 semicolons: $query .= "WHERE id='" . $subject_id ."' ";; And if you skip the concatenation, this should work $query .= "WHERE id='$subject_id' "; In PHP, inside double quotes, single quotes are literal and variables are expanded. The other way you wrote it should work too, but it's more code than needed.

Categories : PHP

PHP MySql double quotes than single quotes
double quotes signify that it's a string and the single quotes are part of a string. inside double quotes variables are evaluated so the string will contain the value of the variable 'vValue' not '$v'

Categories : PHP

Double Quotes in Single Quotes
Escape the quotes in html using &quot; <video id="video1" class="video-js vjs-default-skin" width="640" height="480" data-setup='{ &quot;controls&quot;:true,&quot;autoplay&quot;:false,&quot;preload&quot;: &quot;auto&quot;}'>

Categories : HTML

Creating a dataset variable from a macro variable containing both quotes, double quotes and mismatched quotes
The short answer is that you can use SYMGET here: data _null_; x=symget("problem"); put x=; run; If that is not an option for some reason, provide some more information as to the context. I'll also see if I can point Toby (the SAS-L macro quoting guru) or some of the other folks there here, to see if they have any suggestions for handling this without SYMGET. From SAS-L, FriedEgg (Matt) posted the following additional solution: resolve=resolve('%superq(problem)'); He also notes that you can mask it on the way in, if you have control over that: data _null_; input x $ 1-50 ; call symput('problem',quote(x)); cards4; 'this' "is '' my "string"" from 'hell! ;;;; run; data _null_; x=&problem; put x=; run;

Categories : Sas

Using regexes, how to efficiently match strings between double quotes with embedded double quotes?
A very efficient solution to match such inputs is to use the normal* (special normal*)* pattern; this name is quoted from the excellent book by Jeffrey Friedl, Mastering Regular Expressions. It is a pattern useful in general to match inputs consisting of regular entries (the normal part) with separators inbetween (the special part). Note that like all things regex, it should be used when there is no better choice; while one could use this pattern for parsing CSV data, for instance, if you use Java, you're better off using OpenCSV instead. Also note that while the quantifiers in the pattern name are stars (ie, zero or more), you can vary them to suit your needs. Strings with embedded double quotes Let us take the above example again; and please consider that this text sample may be any

Categories : Regex

Single/double quotes ksh
The "$PWD" resolves immediately. So you're essentially setting PS1 to a fixed value (the value of PWD at the time it's set). When you set to '$PWD', it does not resolve immediately, so it resolves when used, and changes when you change directories. Thus the double quotes are expanding (to a fixed string) as expected, while single quotes are not.

Categories : Unix

Mysql query - couldn't add single quotes within the another single quotes
SET @pid = $memberID = getLoggedId(); $iPid = $GLOBALS['MySQL']->getOne("SELECT `Pid` FROM `Profiles` WHERE `ID` = '$memberID' LIMIT 1"); if($iPid==1){ echo '<div id="id" style="margin:10px 10px 0;" overflow: "hidden;"> <button class="bx-btn bx-btn-img" onclick = "window.open(inviteteacher.php,_self)"> Study with Private Teacher </button> </div>'; }

Categories : PHP

Javascript regex for single, double and no quotes
"width='200', width="200", width=200".replace(/(width=)(?:".*?"|'.*?'|S*)/g, '$1"555"') // => width="555", width="555", width="555" But yeah, this is not a job for regexp.

Categories : Javascript

Excel Escaping Single and double quotes
I find the easiest is to define a variable that contains just the double quote - then use it like any other string. Makes the code much more readable. Example: Dim dq As String, sq as string dq = Chr(34) ' double quote as a variable sq = Chr(39) ' apostrophe or single quote as variable Dim sourceString As String sourceString = "hello" msgbox sq + sourceString + "! " + dq + "you" + dq + sq With these two variables you can create any string you want - after that, replacing what you want with something else (that might contain a crazy sequence of "'"'"'"("!"'") for all I care) becomes trivial. Some helpful rules can be found in this article

Categories : Excel

Escaping quotes and double quotes
Escaping parameters like that is usually source of frustration and feels a lot like a time wasted. I see you're on v2 so I would suggest using a technique that Joel "Jaykul" Bennet blogged about a while ago Long story short: you just wrap you string with @' ... '@ : Start-Process \server oto.exe @' -batch=B -param="sort1;parmtxt='Security ID=1234'" '@ (mind that I assumed which quotes are needed, and which things you were attempting to escape) If you want to work with the output, you may want to add -NoNewWindow switch. BTW: this was so important issue that since v3 you can use --% to stop PowerShell parser from doing anything with your parameters: \server oto.exe --% -batch=b -param="sort1;paramtxt='Security ID=1234'" ... should work fine there (with the same assumption).

Categories : Powershell

Rails email double escaping single quotes
Turns out it was a change one of the other developers had made. They'd added sanitisation to the input so it was being escaped before being stored, and then rails was escaping it when displaying so it was being double escaped. Sorted now :)

Categories : Ruby On Rails

Single and double quotes in textfield, how to make them visible?
printf('<input type="text" name="1" id="1" value="%s">', htmlspecialchars($string)); HTML escape the data. All data you're outputting into HTML, in fact. See The Great Escapism (Or: What You Need To Know To Work With Text Within Text).

Categories : PHP

append values with both single and double quotes to textbox
This is because you are concatenating strings, which doesn't take escaping of special characters into account. You should instead set the value with .val so that the value is escaped properly. Also, the regex is unnecessary. $(document).ready(function(){ var test= "this is vicky"s "s 's 's "s "S"; alert(test); var input = $("<input style='width:700px;' id='testbox'></input>").val(test); $("#test").html("hey this is ").append(input); }); See updated test case on jsFiddle

Categories : Javascript

PHP to output single and double quotes as a value for an input element
Try using htmlspecialchars. This will escape the " in yout title. value="'.htmlspecialchars($title).'">

Categories : PHP

Single-Double quotes error in Full Text Search
You have an extra embedded double quote: CONTAINS(PositionDesired,'"*"JAVA*"') ----------------------------^ This effectively terminates the string early, and SQL Server doesn't understand what that extra stuff is. Should be (I think, not a full-text guru): CONTAINS(PositionDesired,'"*JAVA*"') However, I think that will eliminate the error, but not return the results you are after, since punctuation is ignored. You may have to use a combination of CONTAINS and LIKE, e.g.: CONTAINS(PositionDesired,'JAVA') AND PositionDesired LIKE '%"JAVA"%' Or for the new requirement you've added: CONTAINS(PositionDesired,'JAVA PHP') AND PositionDesired LIKE '%"JAVA"PHP%"' In the LIKE clause you don't have to worry about escaping or doubling-up the double quote, because it isn't a string

Categories : Sql Server

Why do the most languages employ double quotes not single for String Literals?
In some languages double quotes represent strings, and single quotes represent characters. In other languages double quotes can interpolate variables while single quotes can't. JavaScript is not the only one that allows single quotes for strings, PHP does, and so does Ruby, and many others, but in JavaScript there's no difference at all of using one or the other.

Categories : Javascript

how to select numbers that is not between double/single quotes with regular expression in javascript
I would do that : var numbers = str.split('"').filter(function(_,i){ return !(i%2) }).join('') .split("'").filter(function(_,i){ return !(i%2) }).join('') .match(/d+/g); The idea is to start by removing what is between quotes and then applying a regular expression. Demonstration (open the console) But, like any time HTML and regexes are mixed, you'll find cases where it doesn't work. So, if your use case isn't strictly controlled, you'd better parse, for example by applying a regex to element.texContent||element.innerText.

Categories : Javascript

Escape double quotes within double quotes
The problem A finite automaton - the theoretical equivalent of a regex - can't parse recursive structures. Since you can have inner quotes, and possible inner-inner quotes, your problem can't be solved using a regex. Although modern regex engines can overcome this problem with several extensions, don't waste your time on hunting quotes-within-quotes. You'll soon find out that you're actually building a full blown JSON parser. As @johnchen902 stated, even a turing-machine powered parser can not handle ambiguities - so you better not try to suggest a fix to the broken JSON. Solutions Create the JSON using a dedicated utility The given string is not a valid JSON. It's probably created using string concatenation, which is generally a bad idea because it does not escape correctly. You sh

Categories : Java

How do I put single quotes inside of other single quotes?
You can surround them with different quotes in HTML (some of your HTML quotes were unbalanced). In PHP you'll have to escape the inner quotes: echo "<a href="#" onclick="popup('popUpDiv')"><img src='$pic'></a>";

Categories : PHP

SQLite update to change double-double quotes ("") to regular quotation marks (")?
SQLite uses single quotes to escape string literals. It escapes single quotes by adding another single quote (likewise for double quotes). So technically as long as your SQL is well constructed, the import process should work properly. The strings should be enclosed in single quotes, and not double quotes. I suspect that your code may be constructing the SQL by hand instead of binding/properly escaping the values. SQLite has a built in function to quote string's. It's called quote. Here are some sample inputs, and the corresponding output: sqlite> SELECT quote("foo"); 'foo' sqlite> SELECT quote("foo ""bar"""); 'foo "bar"' sqlite> SELECT quote("foo 'bar'"); 'foo ''bar''' So you could remove the twice escaped double quote before it even goes to SQLite using NSString methods. [@

Categories : Iphone

How to catch opening double quotes and closing double qoutes with a regular expression?
You can perform an automatic replacement (in the TextChanged Event of the TextBoxes, as shown below; or just before dealing with the given String). For example: Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged TextBox1.Text = TextBox1.Text.Replace(ChrW(8220), "") TextBox1.Text = TextBox1.Text.Replace(ChrW(8221), "") TextBox1.Text = TextBox1.Text.Replace("""", "") If (TextBox1.TextLength > 0) Then TextBox1.Select(TextBox1.TextLength, 1) End If End Sub This code does not allow users to write ",“ or ”. The reason for a so complicated code is that dealing with "curvy" double quotes (as the ones in your sample code) is not straightforward: VB.NET considers them as normal double quotes in mos

Categories : Asp Net

ANTLRv4: How to read double quote escaped double quotes in string?
Like this: STRING : '"' (~[ "] | '""')* '"' ; where ~[ "] | '""' means: ~[ "] # any char other than ' ', ' ' and double quotes | # OR '""' # two successive double quotes And is it possible to rewrite it to turn double double quotes in single double quotes? Not without embedding custom code. In Java that could look like: STRING : '"' (~[ "] | '""')* '"' { String s = getText(); s = s.substring(1, s.length() - 1); // strip the leading and trailing quotes s = s.replace("""", """); // replace all double quotes with single quotes setText(s); } ;

Categories : Ant

Batch converting straight quotes to smart quotes from MySQL database
I don't know how to enter the smart quotes in Sublime Text 2, but I tested the following regex (in Sublime Text 2 itself) for the single quote case using [] as the replacement characters: Find what: ((?:[^<'>]*|<.*?>)*)'(.*?)' Replace with: $1[$2] Hopefully this will help. Here is rubular for it, showing matches.

Categories : Regex

replace double quotes within double quoted strings
Get the following substring: "brown fox" child* !"big planes" .. and replace quotation marks with: &quot; SET DECLARE OFF; SELECT SUBSTR(str, 1, INSTR(str, '""', 1, 1)) || REPLACE(SUBSTR(str, INSTR(str, '""', 1, 1) + 1, INSTR(str, '""', -1, 1) - INSTR(str, '""', 1, 1)), '"', '&quot;') || SUBSTR(str, INSTR(str, '""', -1, 1) + 1) AS col FROM ( SELECT '<?xml version=...><Fetch searchstr=""brown fox" child* !"big planes"" begin="yesterday" ...><otherele>...</otherele><some>...</some></Fetch>' AS str FROM DUAL ); The result: <?xml version=...><Fetch searchstr="&quot;brown fox&quot; child* !&quot;big planes&quot;" begin="yesterday" ...><otherele>...</otherele><some>...</some&g

Categories : SQL

Replacing dumb quotes for smart quotes with preg_replace
$singlequotesPattern = "/'(.*?)'/"; Add a ? to make the * quantifier non-greedy. A greedy quantifier finds the longest match possible. A non-greedy one finds the shortest. Greedy: Jane said 'How do we do this?' 'I don’t know' replied Sam. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Non-greedy: Jane said 'How do we do this?' 'I don’t know' replied Sam. ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^

Categories : PHP

Replace 2 double quotes with 1 double quote with VBA
Try this, maybe, using FileSystemObject to create the text file/html file: Public Const strResult As String = "<META http-equiv=""Content-Type"" content=""text/html"">" '"document.writeln('<div class=""pagebreak"">');" Sub Test() Dim sFile As String Dim fso As Object 'Scripting.FileSystemObject sFile = "C:users" & Environ("username") & "desktopTNTLabel.html" Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateTextFile(Filename:=sFile, Overwrite:=True).Write strResult Set fso = Nothing End Sub This creates the following text file, note that there are no double-quotes and I did not use any Replace or other string functions to remove them from the strResult: Alternatively, when I used freefile method to write the file, it preserves it as string literal,

Categories : Xml

Can't get the double quotes right
You don't need to add an explicit closing " when concatenating strings: header("Location: /" . $_SESSION['initiating_url'], true, 300); For clarity: $path = 'home'; echo "Location: /" . $path; // Location: /home echo "Location: /home"; // Location: /home echo "Location: /" . $path . """; // Location: /home" echo ""Location: /" . $path . """; // "Location: /home"

Categories : PHP

Put double quotes around a value in XSLT
In response to your comment, I think the issue is with Microsoft Excel here, not with XSLT. The quotation marks are treated as text-delimiters, and normally you would only use them when you have a field with a comma in, to indicate it is just one single field, and not two. In any case, when you read a CSV file into Microsoft Excel, it does not show any text delimiters (regardless of whether the field contains a comma or not), just the text within them. The quotation marks are just not considered part of the text in the field, but are simply used to delimit the text in the field where it might contain special characters. Furthermore, when you save the file as CSV file, Excel will only use text-delimiters where required (i.e. when the field contains a comma). If the CSV file had quotation m

Categories : Xslt

Getting rid of cookie value with double quotes
I'm not entirely sure what your question is. Are you referring to the “%” codes in your tokens? which would be due to this: http://www.w3schools.com/tags/ref_urlencode.asp#encodingresult

Categories : PHP

double quotes use in javascript
Try using html entities for double quotes (as & quot; without blanks) inside the onchange="..." <select name="opt_name%>" onchange="$('#dati_opzioni').append('<input type=&quot;hidden&quot; name=&quot;optdesc_'+<%=opt.getCdOpzione()%>+'&quot; value=&quot;'+<%=optLabel%>+'_'+this.options[this.selectedIndex].text+'&quot;/>');">

Categories : Javascript

PHP output with double quotes
The quotes in your string are extended characters. You could fix this problem pretty quickly by simply replacing them with standard " quote characters rather than the curly quotes “ ” you've got now. However, in the long term, you probably need to be able to handle extended characters, as it includes all kinds of things you're likely to need in your text, not just curly quote marks. To fix this problem properly, you need to ensure that your system uses UTF-8 encoding at all levels. This includes within the database, your PHP code files, and the data that is sent to the browser. I suggest reading up further on this here: UTF-8 all the way through

Categories : PHP

Double Quotes and $_POST
Instead of “test” use ”test” Or Even better use $input_arr = array(); //grabs the $_POST variables and adds slashes foreach ($_POST as $key => $input_arr) { $_POST[$key] = addslashes($input_arr); }

Categories : PHP

how to put the value from a datatable in double quotes
Your code is outputting exactly what you want it to output. You've said in the comments to the question that you're seeing this when you're debugging; this is simply a function of the Watch window, escaping the quote characters for you. Incidentally, your code could be more efficiently written in a number of ways; one example, that is still reasonable readable: colname = ""; foreach (DataColumn co in DT.Columns) { colname += """ + co.ColumnName + "","; } colname = colname.TrimEnd(',');

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.