def str_filter(value, index=0, pattern=None):
    """
    String filter: avoid false positives with random case. A typical string
    should be either:
    - all UPPERCASE
    - all lowercase
    - or Capitalized
    return True if OK, False otherwise.
    Usage: This filter is meant to be used with string patterns that catch words
    with the option nocase=True, but where random case is not likely.
    Note 1: It is assumed the string only contains alphabetical characters (a-z)
    Note 2: this filter does not cover CamelCase strings.
    """
    if value.isupper() or value[1:].islower():
        return True
