I have the situation where I have a property on a node named : ProductName.
And the property is: City 60057 Great Vehicles Camper Van
I want to extract the numbers and put it in it'sown field named Product_code, but also I want to extract the word city and put it in a field named : Theme.
Then remove those values from that property. I was seeing if I could use regEx, but the instructions on the web is realy vague on the use of Regex in Neo4j, but also the second problem is I don't quite understand how to have that selected data written to a property.
My first thought is that "SET" will have to be used in this problem, but not sure how to select only the stuff I need to give to "SET".
if the order is always the same then how about split?
something like this lovely hack ( with all it's pitfalls )
match (p:ProductName)
with p, split(p.myProperty,' ') as words
set p.Product_code = words[1]
set p.Theme = words[0]
set p.myProperty = trim(replace(replace(p.myProperty,words[0],''),words[1],''))
return p
Thank you for this solution. Do you know where I can find clear explanation on how to use REGEX in Neo4j ? the manual doesn't cover it all all, just quick mentions of how it looks, but no clear usage steps.
Ok, let me try that. I am just learning RegEx. There so little information on how to use RegEx in Neo4j.
Can you use RegEx to select the the text and pipe it to a SET clause to fill a property? That would be perfect.
So the match from regex as the property value used for the SET clause.
Are you trying to get Toys ordered by SalesRank? ( i don't know that you can put the where clause the way you typed it above ) might be easier to move this to slack (neo4j-users)