libcypher-parser是否支持REGEX运算符?

时间:2019-02-07 12:31:03

标签: cypher

我正在尝试解析使用=~正则表达式运算符的Cypher查询,但是在尝试使用libcypher-parser时出现错误。

我试图解析Neo4J文档中找到的查询:

WITH ['mouse', 'chair', 'door', 'house'] AS wordlist
UNWIND wordlist AS word
WITH word
WHERE word =~ '.*ous.*'
RETURN word

可以在这里找到:https://neo4j.com/docs/cypher-manual/3.5/syntax/operators/#syntax-using-a-regular-expression-to-filter-words

我尝试了以下命令:

echo "WITH ['mouse', 'chair', 'door', 'house'] AS wordlist UNWIND wordlist AS word WITH word WHERE word =~ '.*ous.*' RETURN word" | cypher-lint -a

我收到此错误:

<stdin>:1:100: Invalid input '~': expected NOT, '+', '-', TRUE, FALSE, NULL, "...string...", a float, an integer, '[', a parameter, '{', CASE, FILTER, EXTRACT, REDUCE, ALL, ANY, NONE, SINGLE, shortestPath, allShortestPaths, '(', a function name or an identifier
...ordlist UNWIND wordlist AS word WITH word WHERE word =~ '.*ous.*' RETURN word
                                                         ^

真的不支持吗?我应该使用哪个版本的libcypher解析器来支持=~运算符?

1 个答案:

答案 0 :(得分:1)

这是0.6.0之前的libcypher-parser中的错误。应该在以后的版本中解决。