Using regular expressions beyond matching in Cypher

前端 未结 2 1615
长情又很酷
长情又很酷 2021-01-25 18:09

I make the following query

neo4j-sh (?)$ start n=node(*) where n.name  =~ \'u(.*)\' return n; 
==> +-----------------------+
==> | n                     |
         


        
2条回答
  •  不知归路
    2021-01-25 18:40

    You can't do that in Cypher (as far as I know)--regex is just for matching.

    If it's always just a single letter in front of it, you can take the substring:

    start n=node(*) 
    set n.userId = substring(n.name, 1)
    

提交回复
热议问题