import re


def extract_version(name):
    """
    Try to extract the version from the DBRelease string.

    :param name: DBRelease (string).
    :return: version (string).
    """
    version = ""

    re_v = re.compile(r'DBRelease-(\d+\.\d+\.\d+)\.tar\.gz')  # Python 3 (added r)
    v = re_v.search(name)
    if v:
        version = v.group(1)
    else:
        re_v = re.compile(r'DBRelease-(\d+\.\d+\.\d+\.\d+)\.tar\.gz')  # Python 3 (added r)
        v = re_v.search(name)
        if v:
            version = v.group(1)

    return version