import re


def extract_id(url):
    """extracts the geonames id from an geonames-URL
    :param url: A GND-URL, e.g. https://www.geonames.org/2772400/linz.html
    :type url: str
    :return: The geonames id, e.g. 2772400
    :rtype: str
    """
    gn_id = "".join(re.findall("[0-9]", url))
    return gn_id