import re


def run(text, meta):
    """Remove refs from the text.

    Returns text with a regex substitution and unchanged META."""

    pat = re.compile(meta.get("ref_regex", "[[(]*ref:[0-9a-f]+[])]*"))
    text = pat.sub("", text)
    
    return text, meta