Case insensitive regex for non-ASCII strings does not work?

人走茶凉 提交于 2019-12-24 03:47:06

问题


With Neo4j 2.1.0-M01, I just discovered that case insensitive regex match does not work with Ukrainian words, at list from web-interface browser. Say I have node with a word 'Ліга' somewhere.

MATCH (n) WHERE n.payload =~ '(?i).*ліга.*' does not match

MATCH (n) WHERE n.payload =~ '(?i).*лІГа.*' does not match

MATCH (n) WHERE n.payload =~ '(?i).*Ліга.*' match Ok

Do I need some deep magic to get it working as expected? Thanks in advance!

WBR, Andrii


回答1:


Not 100% sure, but could you please check if using (?u) helps:

MATCH (n) WHERE n.payload =~ '(?iu).*лІГа.*'

This tells the regex to work case insensitive based on unicode and not on ASCII only.



来源:https://stackoverflow.com/questions/23371028/case-insensitive-regex-for-non-ascii-strings-does-not-work

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