import re

def extract_markdown_images(text: str) -> list[tuple[str, str]]:
    return extract(r"!\[(.+?)\]\((.+?)\)", text)

def extract_markdown_links(text: str) -> list[tuple[str, str]]:
    return extract(r"(?<!!)\[(.+?)\]\((.+?)\)", text)

def extract(pattern: str, text: str):
    return re.findall(pattern, text)

