import re
import string


def num_pattern_matches(text, patterns_lst):
    """
    Checks lowercase text and lowercase punctuation-removed text for patterns

    :param text: (str)
        the body of text to evaluate
    :param patterns_lst: (lst)
        list of regex string patterns to try and match
    :return:
        number of pattern-matches from list detected, NOT the number of total matches
        We do this to "classify" the text using the pattern-detectors.
    """
    if not isinstance(text, str) or not isinstance(patterns_lst, list):
        return 0

    # Replace forward slash, parentheses, and dashes with spaces
    low_replaced_txt = re.sub(r'/|\(|\)|-', ' ', text.lower())

    # Remove all punctuation
    no_punct_lower_text = low_replaced_txt.translate(str.maketrans('', '', string.punctuation))

    matches = 0
    for pattern in patterns_lst:
        pattern_found = re.search(pattern, low_replaced_txt) or \
                        re.search(pattern, no_punct_lower_text)
        if pattern_found:
            matches += 1

    return matches