regex foldermap in js