'Search PATTERN beginning from INDEX until STOPINDEX.
Return the index of the first character of a match or an
empty string.'

def search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None):

    args = [self._w, 'search']
    if forwards:
        args.append('-forwards')
    if backwards:
        args.append('-backwards')
    if exact:
        args.append('-exact')
    if regexp:
        args.append('-regexp')
    if nocase:
        args.append('-nocase')
    if elide:
        args.append('-elide')
    if count:
        args.append('-count')
        args.append(count)
    if (pattern and (pattern[0] == '-')):
        args.append('--')
    args.append(pattern)
    args.append(index)
    if stopindex:
        args.append(stopindex)
    return str(self.tk.call(tuple(args)))
