Change regex to a simple indexOf test

No need to use a regular expression to test for the presence of a space character, when the `indexOf` function does a far more sufficient job.

This could also have been written using the shorter syntax `~options.path.indexOf(' ')`, but some might find that harder to read.