Sync function that returns an array of files matching regex pattern, recursively inside specified directory.