Replace regex test with path.sep check