How to match a single quote in sed

You can either use: “texta’textb” (APOSTROPHE inside QUOTATION MARKs) or ‘texta’\”textb’ (APOSTROPHE text APOSTROPHE, then REVERSE SOLIDUS, APOSTROPHE, then APOSTROPHE more text APOSTROPHE) I used unicode character names. REVERSE SOLIDUS is more commonly known as backslash. In the latter case, you close your apostrophe, then shell-quote your apostrophe with a backslash, then open another apostrophe … Read more

Finding quoted strings with escaped quotes in C# using a regular expression

What you’ve got there is an example of Friedl’s “unrolled loop” technique, but you seem to have some confusion about how to express it as a string literal. Here’s how it should look to the regex compiler: “[^”\\]*(?:\\.[^”\\]*)*” The initial “[^”\\]* matches a quotation mark followed by zero or more of any characters other than … Read more

With “magic quotes” disabled, why does PHP/WordPress continue to auto-escape my POST data?

I think I found it. Problem (bug): http://core.trac.wordpress.org/ticket/18322 Solution: http://codex.wordpress.org/Function_Reference/stripslashes_deep $_GET = array_map(‘stripslashes_deep’, $_GET); $_POST = array_map(‘stripslashes_deep’, $_POST); $_COOKIE = array_map(‘stripslashes_deep’, $_COOKIE); $_SERVER = array_map(‘stripslashes_deep’, $_SERVER); $_REQUEST = array_map(‘stripslashes_deep’, $_REQUEST); Note: As suggested by @Alexandar O’Mara, you might want to reconsider overwriting the superglobals like this. If it’s appropriate for your situation, for example, you … Read more

How do you escape curly braces in javadoc inline tags, such as the {@code} tag

Not so much an answer as a workaround, but if you replace {@code …} with the old version <code>…</code> it will render curly braces how you expect. <code>{person} == ${person}</code> Unfortunately, this breaks angle brackets, so to the original question you need to escape these: <code>&lt;custom:meatball color=”&lt;%= Meatball.RED %&gt; nincompoop=”${person}” /&gt;</code> You can even cheat … Read more

Escape tags in html

Here are some common entities. You do not need to use the full code – there are common aliases for frequently used entities. For example, you can use < and > to indicate less than and greater than symbols. & is ampersand, etc. EDIT: That should be – &lt; &gt; and &amp; EDIT: Another common … Read more

How do I escape a string in Java?

You should use the StringEscapeUtils class from Apache Commons Text (you can also find the class in Apache Commons Lang3 but that one is deprecated). You’ll find that there are plenty of other offerings in Apache Commons that might serve useful for other problems you have in Java development, so that you don’t reinvent the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)