How to pass parameter with regex query

Hello all,

I am trying to query using regular expression in py2neo. However, I ran this query, but It did not work. I tried running the same query directly in Cypher and it worked. I do not know what I am missing.

I appreciate any help.


            propertyNode ="MATCH (n) WHERE$x(s?) RETURN, labels(n)", x=word).data()

Have you tried:

propertyNode ="MATCH (n) WHERE'(?i)' + $x +'(s?)' RETURN, labels(n)", x=word).data()

It did not work either. I want to match keywords like cartype or carType.

What are you using (s?) for?

This actually works:

return "carType"=~ '(?i)' + "car" + '\S+'