Extract replacement token from exception message.

def _get_replacement_token(msg):
    """Extract replacement token from exception message."""
    return (
        None
        if not re.search(r"\*\[[\w|\W]+\]\*", msg)
        else re.search(r"\*\[[\w|\W]+\]\*", msg).group()[2:-2]
    )