added windows and linux replace regex for outPath