问题
It appears that characters like ü and Ü or ł and Ł are treated like completely separate characters in Neo4j for case insensitive regex searches.
The following Cypher should return a node but it doesn't:
CREATE (t:Thing { name: "Łomza Überbrew" })
MATCH (t:Thing) WHERE t.name=~'(?i)łomza überbrew' RETURN t
Is this expected with Neo4j? Using Neo4j Enterprise-2.1.2
Thanks
回答1:
You need to use case-insensitive unicode regex instead of just case-insensitive which just applies to ascii chars. Instead of (?i)
use (?ui)
:
CREATE (t:Thing { name: "Łomza Überbrew" })
MATCH (t:Thing) WHERE t.name=~'(?ui)łomza überbrew' RETURN t
来源:https://stackoverflow.com/questions/28857639/case-of-certain-special-characters-in-neo4j-case-insensitive-regex-searches-don