cleaned getDirOptions function
regex is now based on terms defined in settings