Finds all the files with the specified root directory with the name matching the regex expression.
        Args    :
            root_dir                : The root directory.
            re_expression           : The regex expression.
            return_abs_path         : If set to true, returns the absolute path of the files, else returns the name of the files.
            search_sub_directories  : If set to true, searches sub directories recursivly.

def find_file_regex(root_dir,re_expression,return_abs_path = True,search_sub_directories = True):
    '''
        Finds all the files with the specified root directory with the name matching the regex expression.
        Args    :
            root_dir                : The root directory.
            re_expression           : The regex expression.
            return_abs_path         : If set to true, returns the absolute path of the files, else returns the name of the files.
            search_sub_directories  : If set to true, searches sub directories recursivly.
    '''

    compiled        = re.compile(re_expression)
    result          = []
    for dirpath, dirnames, files in os.walk(root_dir) :
        #Select files matching the expression
        for file in files :
            if compiled.match(file):
                result.append(os.path.join(dirpath,file) if return_abs_path else file )

        #Break if no sub-directories
        if not search_sub_directories :
            break
    return result