Typo in documentation? (https://neo4j.com/docs/operations-manual/current/tutorial/import-tool/)

I'm just getting started with Neo4J, which is incredible!
I'm following the documentation for neo-admin load and think there's a typo? I couldn't get the regular expressions to work unless the paths are in double quotes. They are in the text but not in the example script. Very minor but thought it worth pointing out?

B.2.4.1. Using regular expressions for specifying multiple input files


If we use the regular expression movies4.* , the sorting will place the header file last and the import will fail. A better alternative would be to name the header file explicitly and use a regular expression that only matches the names of the data files. For example: --nodes "import/movies4-header.csv,movies-data.*" will accomplish this.

Using the same data files as in the previous example, the call to neo4j-admin import can be simplified to:

neo4j_home$ bin/neo4j-admin import --nodes=import/movies4-header.csv,import/movies4-part.* --nodes=import/actors4-header.csv,import/actors4-part.* --relationships=import/roles4-header.csv,import/roles4-part.*

I think this might need to be (with quotes)...

neo4j_home$ bin/neo4j-admin import --nodes="import/movies4-header.csv,import/movies4-part.*" --nodes="import/actors4-header.csv,import/actors4-part.*" --relationships="import/roles4-header.csv,import/roles4-part.*"

I believe this got fixed.

this is a general problem in Unix: the command line Globbing expands * and ? (and other special characters). To avoid this, you need to put it in single quotes or double quotes (depending...)

thanks a lot for the explanation (and for prompting me to find out what globbing is :+1:)

One cautionary note: globbing looks like regular expressions, but it's not! Globbing and regex are confusingly similar.

Thanks for the pointer. I think I remember reading ‘if you have a problem and you solve it with regex you now have two problems’. I’ve found regex incredibly useful but I’m never more than 90% sure I know why it’s working for anything beyond very simple stuff. I should read up on both.

Regex takes years (at least months!) of practice.

This will help a lot!

Beware that there are actually a few different versions of regex, which differ in details, so make sure you know which one you are using!

Neo4J has two:

This a great - thanks a lot. I’ve used REGEXP_ in the relational world but regex looks much more baked into cypher. Much more than I’d realised. I’m going to spend some time taking a closer look so thanks again :+1:

Regex GROUPS(in APOC) is very powerful! You can much better deal with complex situations especially with data cleanup.