The directory to search in.
A regex pattern to match against each filename.
Whether to recursively search subdirectories.
How deep to search recursively. -1 indicates infinite recursion.
The single matching file that was found, or null if no match was found, or if multiple matches were found.
Tries to find a single file matching the given pattern.