'Finds the first start_index that is on an uncommented line.
Arguments:
template: The template to be searched.
start_index: The start index of the last open char.
Returns:
If start_index is on an uncommented out line, returns start_index.
Otherwise, returns the start_index of the first line that is
uncommented, if there is one. Otherwise, returns None.'

def _uncommented_start_index(self, template, start_index):

    if (self.LINE_COMMENT_DELIM is not None):
        line_start_index = StringLines(template).index_to_line_start_index(start_index)
        uncommented_line_start_index_regex = re.compile('^(?!\\s*{})'.format(self.LINE_COMMENT_DELIM), re.MULTILINE)
        match = uncommented_line_start_index_regex.search(template, line_start_index)
        if (match is None):
            return None
        elif (match.start() < start_index):
            return start_index
        else:
            return match.start()
    else:
        return start_index
