Expect the number of times a regular expression appears on each line of
        a file to be between a maximum and minimum value.

        Args: 
            regex: \
                A string that can be compiled as valid regular expression to match

            expected_min_count (None or nonnegative integer): \
                Specifies the minimum number of times regex is expected to appear
                on each line of the file

            expected_max_count (None or nonnegative integer): \
               Specifies the maximum number of times regex is expected to appear
               on each line of the file
        Keyword Args:
            skip (None or nonnegative integer): \
                Integer specifying the first lines in the file the method should
                skip before assessing expectations

            mostly (None or number between 0 and 1): \
                Specifies an acceptable error for expectations. If the percentage
                of unexpected lines is less than mostly, the method still returns
                true even if all lines don't match the expectation criteria.

            null_lines_regex (valid regular expression or None): \
                If not none, a regex to skip lines as null. Defaults to empty or whitespace-only lines.

        Other Parameters:
            result_format (str or None): \
                Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`,
                or `SUMMARY`. For more detail, see :ref:`result_format <result_format>`.
            include_config (boolean): \
                If True, then include the expectation config as part of the
                result object. For more detail, see :ref:`include_config`.
            catch_exceptions (boolean or None): \
                If True, then catch exceptions and include them as part of the
                result object. For more detail, see :ref:`catch_exceptions`.
            meta (dict or None): \
                A JSON-serializable dictionary (nesting allowed) that will be
                included in the output without modification. For more detail,
                see :ref:`meta`.
            _lines (list): \
                The lines over which to operate (provided by the file_lines_map_expectation decorator)

        Returns:

            A JSON-serializable expectation result object.

            Exact fields vary depending on the values passed to
            :ref:`result_format <result_format>` and :ref:`include_config`,
            :ref:`catch_exceptions`, and :ref:`meta`.

def expect_file_line_regex_match_count_to_be_between(self,
                                                         regex,
                                                         expected_min_count=0,
                                                         expected_max_count=None,
                                                         skip=None,
                                                         mostly=None,
                                                         null_lines_regex=r"^\s*$",
                                                         result_format=None,
                                                         include_config=False,
                                                         catch_exceptions=None,
                                                         meta=None,
                                                         _lines=None):
        """
        Expect the number of times a regular expression appears on each line of
        a file to be between a maximum and minimum value.

        Args: 
            regex: \
                A string that can be compiled as valid regular expression to match

            expected_min_count (None or nonnegative integer): \
                Specifies the minimum number of times regex is expected to appear
                on each line of the file

            expected_max_count (None or nonnegative integer): \
               Specifies the maximum number of times regex is expected to appear
               on each line of the file
        Keyword Args:
            skip (None or nonnegative integer): \
                Integer specifying the first lines in the file the method should
                skip before assessing expectations

            mostly (None or number between 0 and 1): \
                Specifies an acceptable error for expectations. If the percentage
                of unexpected lines is less than mostly, the method still returns
                true even if all lines don't match the expectation criteria.

            null_lines_regex (valid regular expression or None): \
                If not none, a regex to skip lines as null. Defaults to empty or whitespace-only lines.

        Other Parameters:
            result_format (str or None): \
                Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`,
                or `SUMMARY`. For more detail, see :ref:`result_format <result_format>`.
            include_config (boolean): \
                If True, then include the expectation config as part of the
                result object. For more detail, see :ref:`include_config`.
            catch_exceptions (boolean or None): \
                If True, then catch exceptions and include them as part of the
                result object. For more detail, see :ref:`catch_exceptions`.
            meta (dict or None): \
                A JSON-serializable dictionary (nesting allowed) that will be
                included in the output without modification. For more detail,
                see :ref:`meta`.
            _lines (list): \
                The lines over which to operate (provided by the file_lines_map_expectation decorator)

        Returns:

            A JSON-serializable expectation result object.

            Exact fields vary depending on the values passed to
            :ref:`result_format <result_format>` and :ref:`include_config`,
            :ref:`catch_exceptions`, and :ref:`meta`.

        """
        try:
            comp_regex = re.compile(regex)
        except:
            raise ValueError("Must enter valid regular expression for regex")

        if expected_min_count != None:
            try:
                assert float(expected_min_count).is_integer()
                assert float(expected_min_count) >= 0
            except:
                raise ValueError("expected_min_count must be a non-negative \
                                 integer or None")

        if expected_max_count != None:
            try:
                assert float(expected_max_count).is_integer()
                assert float(expected_max_count) >= 0
            except:
                raise ValueError("expected_max_count must be a non-negative \
                                 integer or None")

        if expected_max_count != None and expected_min_count != None:
            try:
                assert expected_max_count >= expected_min_count
            except:
                raise ValueError("expected_max_count must be greater than or \
                                 equal to expected_min_count")

        if expected_max_count != None and expected_min_count != None:
            truth_list = [True if(len(comp_regex.findall(line)) >= expected_min_count and \
                                len(comp_regex.findall(line)) <= expected_max_count) else False \
                                for line in _lines]

        elif expected_max_count != None:
            truth_list = [True if(len(comp_regex.findall(line)) <= expected_max_count) else False \
                                for line in _lines]

        elif expected_min_count != None:
              truth_list = [True if(len(comp_regex.findall(line)) >= expected_min_count) else False \
                                for line in _lines]
        else:
            truth_list = [True for line in _lines]

        return truth_list