quotes

Rails link_to only hyperlinking part of link

I have <%=link_to distance_of_time_in_words_to_now(post.created_at), post %> ago However I want to make 'ago' show up in link as well. Now its something like '20 minutes ago,' which kind of looks ugly. I want it to look like 20 minutes ago.' I tried using #{} with no success and Google search turns out very little, especially since ...

quotes issue (ruby)

any idea how I can pass correct argument to xpath? There must be something about how to use single/double quotes. When I use variable parser_xpath_identificator = "'//table/tbody[@id=\"threadbits_forum_251\"]/tr'" gives me an incorrect value or parser_xpath_identificator = "'//table/tbody[@id="threadbits_forum_251"]/tr'" gives me an ...

Regex Quoted String with Escaped Quotes in C#

I'm trying to find all of the quoted text on a single line. Example: "Some Text", and "Some more Text" and "Even more text about \"this text\"" I need to get: "Some Text" "Some more Text" "Even more text about \"this text\"" \"[^\"\r]*\" gives me everything except for the last one, because of the escaped quotes. I have read abo...

Escaping quotes from Rails Variables when using them for Javascript?

Hi, I am having problems when trying to use a rails variable within javascript code. For example, I might define a link_to_remote, with parameter :complete => "alert('my_var');" If my_var = "I'm testing.", then the javascript code will break due to the single quote closing the code prematurely. If I try using escape_javascript(my_var)...

Javascript string replacement - what's the best way to do this?

I have a problem trying to transform a given input string to a given output string using regular expressions in Javascript. I'm not even sure if what I'm trying to accomplish can be done with regular expressions, or would be most efficient using some other means. I'm hoping someone can help: I have the following input string: #> Some...

PHP explode the string, but treat words in quotes as a single word.

How can I explode the following string: Lorem ipsum "dolor sit amet" consectetur "adipiscing elit" dolor into array("Lorem", "ipsum", "dolor sit amet", "consectetur", "adipiscing elit", "dolor") So that the text in quotation is treated as a single word. Here's what I have for now: $mytext = "Lorem ipsum %22dolor sit amet%22 consect...

How to make comment-quote function?

We allow commenting on our website (like a blog). Now we want to change it so that people can comment other comments. Our table looks something like this: ID | CommentID | Comment | User | Date ------------------------------------------------------------------------- 1001 | 1 | Nice site ...

Is there any C SQLite API for quoting/escaping the name of a table?

It's impossible to sqlite3_bind_text a table name because sqlite3_prepare_v2 fails to prepare a statement such as: SELECT * FROM ? ; I presume the table name is needed to parse the statement, so the quoting needs to happend before sqlite3_prepare_v2. Is there something like a sqlite3_quote_tablename? Maybe it already exists under a n...

dealing with nested quotes in html generated from c#

i am using a 3rd party library to show tooltips, like so: string tooltip = "test"; output.Write("onmouseover='Tip(\"" + test + "\");'"); // work fine :) i'm having problem with situations like the following where i need quotes for formatting: string tooltip = "<span style='color:red;'>test</span>"; output.Write("onmouseover='Tip(\""...

Strip quotes from a string

Hi. How do I strip Quotes from a string using Delphi? Ex. I need to remove all the quotes from 'A','B','C','D', giving a result of A,B,C,D. I've tried MyVar := jclStrings.StrRemoveChars(sRegions, [#34]); but no luck so far. Thanks, Pieter ...

How to quote in HTML (not blockquote)?

I want to some sample code in a html page. How do I do it, for example I want to show a tag and image tag, in stackoverflow I use 4 spaces: A Tag example: <a href="your_url"></a> Image Tag example: <img...> ...

How do I strip quotes from an input box using PHP

I have this: <input name="title" type="text" class="inputMedium" value="' . $inputData['title'] . '" /> I want to strip quotes from user input so that if someone enters something like: "This is my title" it wont mess up my code. I tried this and it's not working: $inputData['title'] = str_replace('"', '', $_POST['title']); ...

Why is initializing service not in quotes when target service is?

I've just inherited a SQL Server 2005 database that's using service broker (this is part of a bigger project/solution). Everything about the solution is working fine. I'm trying to grok the service broker SQL, and I see this statement. BEGIN DIALOG CONVERSATION @h FROM SERVICE foo_Init TO SERVICE 'foo_Target' ON CONTRACT fooContract ...

Getting ’ instead of an apostrophe(') in PHP

I'v tried converting the text to or from utf8… didn't seem to help Im getting: "It’s Getting the Best of Me" It should be: "It’s Getting the Best of Me" Im getting this data from a url -> http://www.tvrage.com/quickinfo.php?show=Surviver&amp;ep=20x02&amp;exact=0 ...

Finding C#-style unescaped strings using regular expressions

I'm trying to write a regular expression that finds C#-style unescaped strings, such as string x = @"hello world"; The problem I'm having is how to write a rule that handles double quotes within the string correctly, like in this example string x = @"before quote ""junk"" after quote"; This should be an easy one, right? ...

Managing quotes when using CKEditor setData function

Hey! I want to print a table in PHP, each row has a button to load it's content (HTML codes) into the CKEditor instance. $column = '<td><a href="#" onclick="CKEDITOR.instances.editor.setData(' . "'" . $HTMLcode . "');" . '">Load</a></td>'; echo $column; The HTML code also contains quotes because of the CSS styles: <p style='text-a...

PHP regular expression needed to replace line breaks, but only those between quotes

Hey everyone, our customer supplied us with XML data that needs to be processed using PHP. They chose to abuse attributes by using them for big chunks of text (containing line breaks). The XML parser replaces the line breaks with spaces to make the XML W3 compliant. To make sure we do not lose our line breaks, I want to read in the fi...

Should I use php quote escapes for single quotes or use double quotes in arrays?

I realized that I can have problems with single quotes in php arrays: <?php $lang = array( 'tagline' => 'Let's start your project', "h1" => "About Me" ); ?> So I changed it to double quotes: <?php $lang = array( "tagline" => "Let's start your project", "h1" => "About Me" ); ?> Should I use "php quote escapes", inste...

Textparsing and splitting text including/excluding quotation marks

My question is almost identical to an earlier entry I found here but not quite. I need to parse through a textfile where the data is structured in this way: Each item in the file begins with a # followed by the label. The fields in the post is separated by one or more whitespaces. Here comes the part I'm having problem with. Each field...

Escaping quotes-are there other characters that can be used?

I understand escaping quotes etc. for javascript. Are there any other characters that can be used to encase the whole thing rather than just " or '? Both characters will come up in my piece of text and I don't want to have to put a / before each instance So, instead of: ("Some text where he said "I like this, she say's") something ...