def has_answer(answers, text, regMatxh=False):
    """Check if a document contains an answer string."""

    text = normalize(text)

    if regMatxh:
        single_answer = normalize(answers[0])
        if regex_match(text, single_answer):
            return True
    else:
        # Answer is a list of possible strings
        text = tokenize(text)

        for single_answer in answers:
            single_answer = normalize(single_answer)
            single_answer = tokenize(single_answer)

            for i in range(0, len(text) - len(single_answer) + 1):
                if single_answer == text[i : i + len(single_answer)]:
                    return True
    return False
Check if a document contains an answer string.
uprise/DPR/dpr/data/tables.py