I have been for weeks reading and trying to figure out how to use regular expressions in Cypher. And no the website doc has next to nothing there, also that site everyone send me to doesn't actually show neo4j cypher way of doing it.
So my question is. What is the exact code to write the equivalent in cypher of this: \s[a-zA-Z]
Can someone write some normal regular expressions with then the cypher version next to it, because the documentation has nothing that would give you any idea how to write meaningful expressions.
I am attemting to find the toys where the model nr has letters in the field, so I can identify the ones that need to be cleaned up.
So lets start with this and go from there. If what you gave me doesn't work then something is fundamentally wrong.
Are you from Neo4J?
The internet is filled with people who can't get regular expression to work in Neo4j. I spend over six hours yesterday reading every post I can find on the internet, So many people cannot get a clear understanding form the manual, as it give very little explanation.
people refer to java, but there no robust examples of actual uses so you can see how it is actually written. Even the O'reilly "Graph databases", don't cover the topic. It is a very powerful option to have, but there is next to no attention given to it.
// Apoc JSON ADD STORE & INVENTORY
CALL apoc.load.json("file:///lego3-5.json") YIELD value
WITH value AS v
WITH apoc.text.regexGroups ( v.Product_Price, '\\d{1,3},\\d{1,2}' ) as price
RETURN price
And I get an output of ( See attachment), but I cant use unwind to get them out of the nested list. Was at it for about 6 hours getting to this point and trying everything I can. The manual didn't explain how to use it further than the Return example.
I keep asking myself, why is the manual so bad. I never really explains as you would expect a manual to explain a subject, it is often a brief overview.
Try returning price[0] to get the first element of the list of price(s) instead of the list of the single price. (European style of numbers with comma instead of decimal point.)
I uploaded a file with a sample of the data.
As you will see the price has a comma in the price ( europe ). So the RegEx is written to capture that. It is one price.
the issue still remains, as to not being able to get the value out of this nested list, and I don't understand why apoc is doing that, the manual is very limited.