Skip to content

Commit 9eab45a

Browse files
better Unicode example
1 parent df9e288 commit 9eab45a

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

modules/ROOT/pages/syntax/parsing.adoc

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,38 @@
66
This page provides a general overview of how Cypher parses an input `STRING`.
77

88
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.
1010

1111
== Using unicodes in Cypher
12+
1213
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+
|===
1334

1435
Additional documentation on escaping rules for `STRING` literals, names and regular expressions can be found here:
1536

1637
* xref::queries/expressions.adoc#expressions-string-literals[String literal escape sequences]
1738
* xref::syntax/naming.adoc#symbolic-names-escaping-rules[Using special characters in names]
1839
* xref::clauses/where.adoc#escaping-in-regular-expressions[Regular expressions]
1940

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-
2741
The Unicode version used by Cypher depends on the running JVM version.
2842

2943
[options="header", cols="1,2,3"]

0 commit comments

Comments
 (0)