import re


def get_text_refs(url):
    """Return the parsed out text reference dict from an URL."""
    text_refs = {'URL': url}
    match = re.match(r'https://www.ncbi.nlm.nih.gov/pubmed/(\d+)', url)
    if match:
        text_refs['PMID'] = match.groups()[0]
    match = re.match(r'https://www.ncbi.nlm.nih.gov/pmc/articles/(PMC\d+)/',
                     url)
    if match:
        text_refs['PMCID'] = match.groups()[0]
    match = re.match(r'https://www.biorxiv.org/content/([^v]+)v', url)
    if match:
        text_refs['DOI'] = match.groups()[0]
    return text_refs