import re


def _content_checker(regex: str, content: str) -> str:
    """Helper function to check if a string is obeying the rule described by a regex string or not.

    Args:
        regex: A regex string defines valid content.
        content: A string to be validated.

    Returns:
        A string of error message if validation fails, or an empty string if validation succeeds.
    """
    matched = re.fullmatch(regex, content)

    if not matched:
        return 'Invalid label: %s does not match the regex %s.\n' % (content, regex)
    else:
        return ''