Reputation: 618
I use the Cineasts Movies & Actors (12.3MB) dataset, and I want to get the path from Kevin Bacon and all the US actors he has played with, who have also played in a Drama film. So I've made this cypher query, which returns no row:
START KB=node(759)
MATCH (KB)-->(m1)<--(p)-->(m2)
WHERE HAS(p.birthplace) AND p.birthplace =~ ".*(USA|United States)" AND m2.genre = "Drama"
RETURN m1, p, m2
However if I get rid off the regexp (p.birthplace = "USA"
), it returns one result. What is wrong? The initial query should return at least one row. I'm using Neo4j 1.9.2.
Upvotes: 0
Views: 182
Reputation: 732
Actually this is more REGEX than neo4j or cypher. Your are missing parantheses. (USA|United States) Means USAnited States OR USUnited States, bc the | is ORing the two Characters A and U. Try ((USA)|(United States))
EDIT: PS, try this site for some great regex support and tests http://gskinner.com/RegExr/
Upvotes: 2