import re

def find(pac, user, helpers):
    sudo_get_output = helpers['sudo_get_output']
    get_domain = helpers['get_domain']
    get_usage = helpers['get_usage']
    get_pip_package_version = helpers['get_pip_package_version']
    get_js_package_version = helpers['get_js_package_version']

    result = []

    app = "DokuWiki"
    # 2>&- suppresses the error output if the directory does not exist
    cmd = f'cd ~ && ls -1 -d dokuwiki-* 2>&-'
    lines = sudo_get_output(pac, user, cmd)
    if not lines:
        filename = f"/home/pacs/{pac}/users/{user}/dokuwiki/VERSION"
        cmd = f'if [ -f {filename} ]; then cat {filename}; fi'
        lines = sudo_get_output(pac, user, cmd)
    if lines:
        for line in lines:
            found = False
            version = None
            if line.startswith("dokuwiki-"):
                found = True
                version = '-'.join(line.split('-')[1:])
            elif ' ' in line:
                found = True
                version = line.split(' ')[0]

            if found and version:
                (scheme, domain) = get_domain(pac, user)
                (ram, ssd, hdd) = get_usage(pac, user)
                result.append([app, version, pac, user, scheme, domain, ram, ssd, hdd])

    return {'list': result}
