import re


def url_to_qid(url: str) -> str:
    """
    Maps Wikidata URL of an entity to QID e.g. http://www.wikidata.org/entity/Q7187777 -> Q7187777.
    """

    return re.findall(r"(Q\d+)", url)[0]