How can I escape a single quote in a single-quote string in Bash?

echo ‘I\’m a student’ does not work. But the following works: echo $’I\’m a student’ From the man page of bash: A single quote may not occur between single quotes, even when preceded by a backslash. …. Words of the form $’string’ are treated specially. The word expands to string, with backslash-escaped characters replaced as … Read more

What does an escaped ampersand mean in Haskell?

It escapes… no character. It is useful to “break” some escape sequences. For instance we might want to express “\12” ++ “3” as a single string literal. If we try the obvious approach, we get “\123” ==> “{” We can however use “\12\&3” for the intended result. Also, “\SOH” and “\SO” are both valid single … Read more

How can I match double-quoted strings with escaped double-quote characters?

/”(?:[^\\”]|\\.)*”/ This is almost the same as Cal’s answer, but has the advantage of matching strings containing escape codes such as \n. The ?: characters are there to prevent the contained expression being saved as a backreference, but they can be removed. NOTE: as pointed out by Louis Semprini, this is limited to 32kb texts … Read more

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