I encountered an issue about fuzzy query with cypher that puzzled me for one week.
If I'd like to query a person who has the skill contains C++ (ignore the upper case or lower case) , the query below runs well in desktop browser:
match p = (a:Person {user_id:'18501700312'})-[r0..2]->()-[r1]->(b:Person)
where r1.skill =~ '.(?i)C++.*'
But it runs with error if I'd like to query a person who has the skill contains C+++ (ignore the upper case or lower case) ,
match p = (a:Person {user_id:'18501700312'})-[r0..2]->()-[r1]->(b:Person)
where r1.skill =~ '.(?i)C+++.*'
Error msg :
ERROR Neo.ClientError.Statement.SemanticError
Invalid Regex: Dangling meta character '+' near index 9 .(?i)C+++.
I thought + is a special character in cypher , I tried to use escape sign (\) , it does not work well , who can help with this ? Any suggestion would be appreciated , looking forward to your feedback.
Try below query for C+++
match p = (a:Person {user_id:'18501700312'})-[r 0..2]->()-[r1]->(b:Person)
where r1.skill =~ '.*(?i)c\+{3}'
Note: There are two backslash rather than one. editor is not displaying it.
Updated the post to incorporate case insensitive