improve regex for local vs npm requires