'Finds the indices of a string inside a template.
Arguments:
template: The template to be searched.
start_index: The start index of the open quote.
Returns:
A dict containing the following, or None if not parseable:
end_index: The index following the closing quote
quote_length: The length of the quote.  Could be 3 for a Python
triple quote.
string: the text of the parsed string
string_inner: the text inside the quotes of the parsed string'

def _parse_string(self, template, start_index):

    quote = template[start_index]
    if (quote not in ["'", '"']):
        raise ValueError('start_index    must    refer    to    a    single    or    double    quote.')
    triple_quote = (quote * 3)
    if template.startswith(triple_quote, start_index):
        quote = triple_quote
    next_start_index = (start_index + len(quote))
    while True:
        quote_end_index = template.find(quote, next_start_index)
        backslash_index = template.find('\\', next_start_index)
        if (quote_end_index < 0):
            return None
        if (0 <= backslash_index < quote_end_index):
            next_start_index = (backslash_index + 2)
        else:
            end_index = (quote_end_index + len(quote))
            quote_length = len(quote)
            string = template[start_index:end_index]
            return {'end_index': end_index, 'quote_length': quote_length, 'string': string, 'string_inner': string[quote_length:(- quote_length)]}
