Python Forum

Full Version: python escaping character
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

How can i escape the special character from this sql . it is store as string

SELECT REGEXP_SUBSTR(SYS_CONNECT_BY_PATH(nom, '\'), '[^\]+', 3, 4)
SELECT REGEXP_SUBSTR(SYS_CONNECT_BY_PATH(nom, '\\'), r'[^\]+', 3, 4)
The first literal \ must be escaped with another \.

Using a raw string (sometimes called regex string) does not help, because after the backslash comes the quotation mark.

The second string literal can be written as raw string, because the quotation mark does not follow after the backslash.