def _count(expr, pat, flags=0):
    """
    Count occurrences of pattern in each string of the sequence or scalar

    :param expr: sequence or scalar
    :param pat: valid regular expression
    :param flags: re module flags, e.g. re.IGNORECASE
    :return:
    """
    return _string_op(expr, Count, output_type=types.int64,
                      _pat=pat, _flags=flags)
Count occurrences of pattern in each string of the sequence or scalar

    :param expr: sequence or scalar
    :param pat: valid regular expression
    :param flags: re module flags, e.g. re.IGNORECASE
    :return: