Skip to content

Commit 9148bb7

Browse files
Better Unicode example on Parsing page (#1177)
1 parent cb232d3 commit 9148bb7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

modules/ROOT/pages/syntax/parsing.adoc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@
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+
For example, the below query uses the Unicode `u00B0` to search for any recipe descriptions containing the degree symbol, `º`:
15+
16+
.Using Unicodes in `STRING` matching
17+
[source, cypher]
18+
----
19+
MATCH (r:Recipe)
20+
WHERE r.description CONTAINS "\u00B0"
21+
RETURN r
22+
----
1323

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

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

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

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

0 commit comments

Comments
 (0)