|
6 | 6 | This page provides a general overview of how Cypher parses an input `STRING`. |
7 | 7 |
|
8 | 8 | The Cypher parser takes an arbitrary input `STRING`. |
9 | | -While the syntax of Cypher is described in subsequent chapters, the following details the general rules on which characters are considered valid input. |
| 9 | +This page details the general rules on which characters are considered valid input. |
10 | 10 |
|
11 | 11 | == Using unicodes in Cypher |
| 12 | + |
12 | 13 | Unicodes can generally be escaped as `\uxxx`. |
| 14 | +In the below example, the Unicode `\u03B1\u03B2` is used to create a property named `αβ`. |
| 15 | + |
| 16 | +.Using Unicodes in property names |
| 17 | +[source, cypher] |
| 18 | +---- |
| 19 | +CREATE (n:Test {\u03B1\u03B2: "AlphaBetaExample"}) |
| 20 | +WITH n |
| 21 | +MATCH (n:Test) |
| 22 | +RETURN properties(n) AS property |
| 23 | +---- |
| 24 | + |
| 25 | +.Result |
| 26 | +[role="queryresult",options="header,footer",cols="1*<m"] |
| 27 | +|=== |
| 28 | +| property |
| 29 | + |
| 30 | +| {αβ: "AlphaBetaExample"} |
| 31 | + |
| 32 | +d|Rows: 1 |
| 33 | +|=== |
13 | 34 |
|
14 | 35 | Additional documentation on escaping rules for `STRING` literals, names and regular expressions can be found here: |
15 | 36 |
|
16 | 37 | * xref::queries/expressions.adoc#expressions-string-literals[String literal escape sequences] |
17 | 38 | * xref::syntax/naming.adoc#symbolic-names-escaping-rules[Using special characters in names] |
18 | 39 | * xref::clauses/where.adoc#escaping-in-regular-expressions[Regular expressions] |
19 | 40 |
|
20 | | -The following example escapes the unicode character `A` (`\u0041`) in the keyword `MATCH`: |
21 | | - |
22 | | -[source, syntax] |
23 | | ----- |
24 | | -M\u0041TCH (m) RETURN m; |
25 | | ----- |
26 | | - |
27 | 41 | The Unicode version used by Cypher depends on the running JVM version. |
28 | 42 |
|
29 | 43 | [options="header", cols="1,2,3"] |
|
0 commit comments