Fixing regex used to extract the dir name