I can search for regular expressions in cypher
MATCH (n:model) WHERE n.name =~ '.*&.*;.*' RETURN n.name
but can I also replace them? I would like to write something like
MATCH (n:model) RETURN replace(n.name, ~'&.*;', '_');
There is a replace function in cypher, but it does not replace regexps, just simple strings.
Maybe a feature request for replaceRegex
could be done?
An workaround would be to do this programatically, after you return the names (if you use call cypher queries from another application).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With