Case of certain special characters in Neo4j case insensitive regex searches don't seem to be matching

拥有回忆 提交于 2019-12-11 03:13:44

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!