Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ - change escape character

In PL\SQL code which I am editing with Notepad++ I have following:

where REGEXP_SUBSTR (a.val, '(\d+)\', 1, 1, NULL, 1) = b.key

Because of \' Notepad++ does not interpret ' as quote closure and rest of source do not have syntax coloring - it has grey color like quoted text.
Is there any way to tell Notepad++ to do not interpret \ as escape character, thus \' will be interpreted as valid end of quote?
I was searching program preferences, but without any success.

EDIT
Strange. When I open new new file, type this line, choose Language > S > SQL then text is highlighted OK. But when I change tab and then return I have bad coloring again. Choosing Language > S > SQL again makes no difference.

like image 717
Michał Herman Avatar asked Aug 19 '15 10:08

Michał Herman


People also ask

What is the '\ n escape character?

In particular, the \n escape sequence represents the newline character. A \n in a printf format string tells awk to start printing output at the beginning of a newline.

How do I remove the last character in notepad?

But just use the find and replace. Look for ":\n" and replace with "\n" or something like that. You may need to mess with the find and replace options.

How do you type escape characters?

Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences.


2 Answers

There is now an option in Notepad++ (since 2014-05-11) to ignore backslash as an escape character for SQL.

Uncheck the box at 'Settings' - 'Preferences' - 'MISC.' - 'Treat backslash as escape character for SQL'

(In v7.7.1, at least, you need to restart np++ for this change to take effect.)

like image 144
brewmanz Avatar answered Oct 22 '22 03:10

brewmanz


In case of Oracle PL/SQL I've changed escape character after e.g. character E from:

LIKE 'E\_%' ESCAPE '\' 

to:

LIKE 'E?_%' ESCAPE '?' 

which did the trick. Not a solution, but if the escape character change is OK, it will do the trick.

like image 1
ilicalex Avatar answered Oct 22 '22 02:10

ilicalex