cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

RegEx in Cypher

stugorf
Node Clone

Regex patterns in Cypher do not appear to implement some PCRE features like lookahead or lookbehind. I am trying a pattern that works in www.regex101.com but not in cypher:

WITH [x in keys(row) WHERE x =~ '(?<=Test\\s)[\\w\\s]*(?=-Plate\\sID)' | x ] AS panels

I am escaping backslashes due to errors reported in console.

1 ACCEPTED SOLUTION

Neo4j is relying here on the JVM's regex implementation which is not listed as a flavour on www.regex101.com. See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for a syntax description.

View solution in original post

2 REPLIES 2

Neo4j is relying here on the JVM's regex implementation which is not listed as a flavour on www.regex101.com. See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for a syntax description.

stugorf
Node Clone

Thank you! This is the reference I need. I should have made the connection between Java and the implementation of regex that Neo4j uses.