module Neo4j::Core module CypherTranslator # Cypher Helper def escape_value(value) result = case value when String sanitized = sanitize_escape_sequences(value) "'#{escape_quotes(sanitized)}'" else value end result end # Only following escape sequence characters are allowed in Cypher: # # \t Tab # \b Backspace # \n Newline # \r Carriage return # \f Form feed # \' Single quote # \" Double quote # \\ Backslash # # From: # http://docs.neo4j.org/chunked/stable/cypher-expressions.html#_note_on_string_literals SANITIZE_ESCAPED_REGEXP = /(?