Allow replace pattern with empty string

expression if (opts.replace) is false for empty string

Resolves https://github.com/codio/server/issues/390