I'm trying to use a regular expression with -output_uri_replace, and it is failing.
Here is my options file:
import
-host
localhost
-port
8877
-username
xxxx
-password
xxxx
-input_file_path
to-import
-output_uri_replace
^.*(/[^/]+/),$1
I consistently get this error:
$ import
java.lang.IllegalArgumentException: Invalid option argument for output_uri_replace :^.*(/[^/]+/),$1
at com.marklogic.contentpump.Command.applyCommonOutputConfigOptions(Command.java:2422)
at com.marklogic.contentpump.Command$1.applyConfigOptions(Command.java:470)
at com.marklogic.contentpump.Command$1.createJob(Command.java:370)
at com.marklogic.contentpump.ContentPump.runCommand(ContentPump.java:238)
at com.marklogic.contentpump.ContentPump.main(ContentPump.java:74)
which is obviously not very helpful. I don't know why it doesn't report the error from the regex engine, which is capable of giving useful messages.
I tried with and without quotes. No difference.
Just to prove it works, here is what happens in Groovy (which uses the same regex engine as Java)
This is exactly the result I want. And by the way, wouldn't this be a common case? You have a bunch of stuff in the directory immediately below and you want to lop off everything but that?
Couldn't there be a working example in the documentation?
And why the @#$% doesn't this work in MLCP when it's clearly a valid regex?