def _prevalidationCheck(value, blank, strip, allowlistRegexes, blocklistRegexes, excMsg=None):
<EOL>value = str(value)<EOL>value = _getStrippedValue(value, strip)<EOL>if not blank and value == '<STR_LIT>':<EOL><INDENT>_raiseValidationException(_('<STR_LIT>'), excMsg)<EOL><DEDENT>elif blank and value == '<STR_LIT>':<EOL><INDENT>return True, value <EOL><DEDENT>if allowlistRegexes is not None:<EOL><INDENT>for regex in allowlistRegexes:<EOL><INDENT>if isinstance(regex, re.Pattern):<EOL><INDENT>if regex.search(value, re.IGNORECASE) is not None:<EOL><INDENT>return True, value <EOL><DEDENT><DEDENT>else:<EOL><INDENT>if re.search(regex, value, re.IGNORECASE) is not None:<EOL><INDENT>return True, value <EOL><DEDENT><DEDENT><DEDENT><DEDENT>if blocklistRegexes is not None:<EOL><INDENT>for blocklistRegexItem in blocklistRegexes:<EOL><INDENT>if isinstance(blocklistRegexItem, str):<EOL><INDENT>regex, response = blocklistRegexItem, DEFAULT_BLOCKLIST_RESPONSE<EOL><DEDENT>else:<EOL><INDENT>regex, response = blocklistRegexItem<EOL><DEDENT>if isinstance(regex, re.Pattern) and regex.search(value, re.IGNORECASE) is not None:<EOL><INDENT>_raiseValidationException(response, excMsg) <EOL><DEDENT>elif re.search(regex, value, re.IGNORECASE) is not None:<EOL><INDENT>_raiseValidationException(response, excMsg) <EOL><DEDENT><DEDENT><DEDENT>return False, value<EOL>
Returns a tuple of two values: the first is a bool that tells the caller
    if they should immediately return True, the second is a new, possibly stripped
    value to replace the value passed for value parameter.

    We'd want the caller immediately return value in some cases where further
    validation isn't needed, such as if value is blank and blanks are
    allowed, or if value matches an allowlist or blocklist regex.

    This function is called by the validate*() functions to perform some common
    housekeeping.