I am trying to write a script that searches a directory and it's subdirectories etc for files matching a given regular expression. So I have started by attempting to write a function to get the directories and subdirectories first. For some reason it currently only seems to get the first subdirectory in the specified directory.I am trying to write a script that searches a d