import re


def count_n_reps_or_n_chars_following(text, n=1, char=""):
    """
    Counts how often characters are repeated for n times, or
    followed by char n times.

    text: UTF-8 compliant input text
    n: How often character should be repeated, defaults to 1
    char: Character which also counts if repeated n times
    """
    
    if char == "":
        
        findall_n_reps = re.findall(rf'([\s\S])(?=\1{{{n}}})', text)
        
        return len(findall_n_reps)
        
    else:
        
        if char in '<([{\\^-=$!|]})?*+.>':
            char = f'\\{char}'
        
        print(char)
    
        findall_n_chars_following = re.findall(rf'([\s\S])(?=\1{{{n}}})|([\s\S])(?={char}{{{n}}})', text)
        
        print(findall_n_chars_following)
    
        return len(findall_n_chars_following)