java,regex,string,double-quotes
A simple non-regex way to do it: public static String[] split(String input) { if (input.charAt(0) == '"') { return input.substring(1).split("\" "); } else { return input.substring(0, input.length() - 1).split(" \""); } } First check whether the first character is ". Then remove the quote from either beginning or the end...
You can use looakaheads/behinds if supported (?<=\\").*?(?=\\") DEMO Anyway, if not supported, just use \\"(.*?)\\" and take Group 1....
javascript,jquery,double-quotes,apostrophe
What you're looking to do is sanitize your input. To do this, you might define a helper method which replaces any unsafe characters with either the Unicode equivalent or the HTML entity. Not only is this sort of thing used for escaping quotes, but it can also help prevent things...
mysql,csv,double-quotes,sqlyog
Try the following settings from SQLyog (12.1.2): ...
Seems like a problem with double quotes. Try changing your first grep to /usr/bin/grep -v '#' and the second grep to /usr/bin/grep '^>'
c#,programming-languages,double-quotes,verbatim-string
So technically, string [email protected]""Hello""; should print "Hello" No, that would just be invalid. The compiler should - and does - obey the rules of the language specification. Within a verbatim string literal, double-quotes must be doubled (not tripled) to distinguish them from the double-quote just meaning "the end of...
c++,operators,stdstring,double-quotes,null-character
The first thing to note is that std::string does not have a constructor that can infer the length of a string literal from the underlying array. What it has is a constructor that accepts a const char* and treats it as a null-terminated string. In doing so, it copies characters...
$data = array( 'title'=> $_POST['title'], 'lat'=> (float) $_POST['lat'], 'lng'=> (float) $_POST['lng'], 'description'=> $_POST['description'], 'category'=> $_POST['category'], ); Cast the strings into floats...
python,string,python-3.x,double-quotes
In Python you can create multiline strings with """...""". Quoting the documentation for strings, String literals can span multiple lines. One way is using triple-quotes: """...""" or '''...'''. In your first case, ""s"" is parsed like this "" (empty string literal) s "" (empty string literal) Now, Python doesn't know...
name=foo since the value is not present inside quotes, it won't accept the value which has spaces like name=foo bar name='foo' this won't expand the text present in the value. That is foo $bar would be read as literal foo $bar. It won't expand $b name="foo" values within the double...
sh,double-quotes,single-quotes
When you build a command, delay the interpolation and use eval to execute it. HOSTNAMES='host1, host2' cmd_options='' if [ "$HOSTNAMES" != "" ]; then cmd_options+='--hostnames "$HOSTNAMES"' fi eval "prog $cmd_options" A better solution is to use an array. HOSTNAMES='host1, host2' cmd_options=() if [ "$HOSTNAMES" != "" ]; then cmd_options+=(--hostnames "$HOSTNAMES")...
php,mysql,quotes,mariadb,double-quotes
Just use htmlspecialchars() instead of str_replace() $url = 'en.wikipedia.org%2Fwiki%2F%22Heroes%22'; // it comes in this way from the DB //$tmp = str_replace('%22','"', $url); $url_input = htmlspecialchars(urldecode($url)); echo "<input type=\"text\" value=\"$url_input\" />"; I think it will work better than this...
powershell,csv,exchange-server,double-quotes
You can "roll your own" csv file: $Outfile = ".\cloud.csv" 'LegacyExchangeDN,CloudEmailAddress,OnPremiseEmailAddress' | Set-Content $Outfile foreach($user in $MailBoxList) { $Data = @( $user.LegacyExchangeDN, $CloudEmailAddress, $user.PrimarySMTPAddress.ToString() ) '"{0}",{1},{2}' -f $Data | Add-Content $Outfile } ...
php,mysql,escaping,double-quotes
You need to concatenate the output of str_replace() into your string. $result=mysql_query( "SELECT * FROM `offers` WHERE ( type='$tran' && imob='$typeimob' && ( '".str_replace("_"," ",$zone)."' LIKE CONCAT('%',area,'%') ) ) ORDER BY `price` DESC LIMIT 0, 50;"); By the way, if you are using an IDE like Eclipse PDT, these things...
I found a workaround for this, in CSV I changed double quote with a special symbol & in application I replaced special symbol with duble quote.
tf <- tempfile() csv <- '"Column 1","Column 2","Column 3","Column 4","Column 5"\n\n2,"A,A","B,Z","C,C",44\n\n3,"A,X","B,B","C,C",121' writeLines( csv , tf ) x <- read.csv( tf ) Column.1 Column.2 Column.3 Column.4 Column.5 1 2 A,A B,Z C,C 44 2 3 A,X B,B C,C 121 ...
html,string,jsp,quotes,double-quotes
I'm not a JSP expert but can you not just escape the quotes like this?: out.println("<input ... onchange=\"doSomething('str2','str1')\"/>"); Or alternatively switch your quotes round: out.println('<input type="text" value="'+s+'" ... onchange="doSomething(\'str2\',\'str1\')"/>'); Or alternatively use templating and only output dynamic content where necessary and have the rest as standard HTML. <input type="text" value="<%=...
I found that the pattern from zx81 $re_dq_answer = '/="(?:[^"]|"")*"/' results in backtracking after every single matched character. I found that I could adapt the pattern found at the very top of my question to suit my need. $re_dq_orignal = '/="[^"\\\\]*(?:\\\\.[^"\\\\]*)*"/s'; becomes $re_dq_modified = '/="([^"]*(?:""[^"]*)*)"/'; The 's' pattern modifier isn't...
Use regular quotes (double quotes ", or quotes '), fellow :) ¨ is too exotic for bash so it splits down your message into tokens by whitespaces and pass these tokens separately to git. In unix-like systems, unlike MS Windows cmd.exe, (well, MinGW and Cygwin are unix-like too :) )...
command-line,terminal,quotes,double-quotes,cp
You need quotes if you don't want the shell expanding the arguments, but instead want the argument passed through verbatim to whatever program you're trying to run. See, for example, the following program: #include <stdio.h> int main (int argc, char *argv[]) { printf ("Argument count = %d\n", argc); for (int...
I found an appropriate solution, but still I had to movify source. I use map instead of an array: def projectMap = [:] for (p in projectList){ projectMap[p.replaceAll("\"",""")] = p } and use it in select: <g:select class="form-control sbt-color" name="project" value ="${params.project.encodeAsHTML()}" from="${projectMap.entrySet()}" optionKey="value" optionValue="key"/> Btw, I need .encodeAsHTML() here...
java,string,escaping,double-quotes
If you want to to test your script with Java, with parameters containing quotes, you don't have any choice, you'll have to escape it. String[] command = new String[] { "path/executeScript", "--path=" + p, "--user=" + user, "--html=\"anchor bold\"", "--port=8081" } Runtime.getRuntime().exec(command); Technical explanation : http://stackoverflow.com/a/3034195/2003986...
python,string,quotes,double-quotes
Python tries to give the most "natural" representation of the string it's repr-ing. So, for example, it will use " if the string contains ' because "that's the ticket" looks better than 'that\'s the ticket'. And there are actually four ways to quote strings: single quotes — ' and "...
php,html,escaping,double-quotes
Applying urlencode on both vars would actually be sufficient. This escapes all special characters, including quotes. Technically it's also in HTTP attribute context, so adding htmlspecialchars() would be professional. Most correctly, though this is slightly overpedantic, you would first cover the URL parameter context, then the JavaScript string context, then...
batch-file,for-loop,pipe,environment-variables,double-quotes
Thanks to Dave Benham's answer on a related issue I've found the solution! It appeared to be a specific FOR /F bug in WinXP, and guess what, here I'm still on WinXP. To fix the main offender, the curl-pipe-jq-for-loop, I had to put ^" in front of and after the...
javascript,quotes,double-quotes
It should be document.getElementById("loggedin") .innerHTML="welcome " + user + "<a onclick='deletecookie()'> yes </a>"; Refer to this question for why quotes should be included around HTML5 attributes. Generally speaking though, it's better to bind something like this via a jQuery event listener within your javascript code rather than injecting it into...
How about creating a new string with snprintf? char somestr[..]; snprintf(somestr, sizeof somestr, "\"%s\"", appPath); ...
php,html,variables,double-quotes,heredoc
You are generating invalid HTML: <input type="text" value="Name is "Bob""> Please use htmlspecialchars() to encode $variable before insertion....
python,csv,merge,double-quotes
I think this will get rid of the quotes which are being caused by not telling thecsv.readers being created that the delimiters in the input file are"|"characters rather than default which is"," characters. merge_list = glob.glob(gndlbsum + "*gndlbsum.csv") file_writer_lbsum = os.path.join(target_dir, "gndlbsum_master.csv") # Append each csv file in the list...
May be this helps sub('.*:\"(.*)\"', '\\1', X1) #[1] "ers39230" "sfe304" Or using stringi with regex lookahead/lookbehind library(stringi) stri_extract(X1, regex='(?<=\").*(?=\")') #[1] "ers39230" "sfe304" data X1 <- c('abcde:"ers39230"' , 'efb:"sfe304"') ...
jquery,double-quotes,single-quotes
This is simply how js is parsed. You have to remember that you're passing a STRING as an argument to the jquery function. In this particular string, there is an expression that jquery parses (a selector), that can contain a quotation mark. If you use the same type of quote,...
php,regex,double,double-quotes
Your question is a bit confusing so let me describe what your regular expression does: preg_match('/[^a-zA-Z0-9 \"\'\?\-]/', $v) It will match any string which DOES NOT contain a-zA-Z0-9 \"\'\?\- Also you are escaping your " with \" which is not necessary. Try removing the back slash. The input test" should...
regex,string,perl,replace,double-quotes
It is working, check out this my $str = 'dev-phase-to-improve == "NOTEQUAL"'; $str=~ s/dev-phase-to-improve == "NOTEQUAL"/\!dev-phase-to-improve=""/g; print $str."\n"; ...