graph databases – Apache Age: Regex in opencypher queries
You can use the =~ operator with various regex such as:
SELECT *
FROM cypher('graph_name', $$
MATCH (n:Person)
WHERE n.name =~ '(?i)TIM.*'
RETURN n.name
$$) as (name agtype);
which will return the names starting with the characters ‘Tim’ (case-insensitive) of nodes labelled ‘Person’. Take a look at the Regular expressions section of the Neo4j documentation.
And the replace() function as such:
SELECT *
FROM cypher('graph_name', $$
RETURN replace('identifier.expression', '.', '_')
$$) as (v agtype);
which will return
v
-------------------------
"identifier_expression"
(1 row)
Read more here: Source link
