PyDocs

Nav

Graphical user interfaces with Tk

Text.search

tkinter

method of Text
  • Text.search(pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None, *, nolinestop=None, strictlimits=None)
Search for pattern starting at index and return the index of the first character of the first match, or an empty string if there is no match. Searching stops at stopindex if given; otherwise it wraps around the ends of the text until the starting position is reached again. The following boolean keyword flags control the search: forwards or backwards select the direction (forward is the default); exact (the default) or regexp select literal or regular-expression matching; nocase makes the match case-insensitive; elide causes hidden text to be searched as well; nolinestop (regexp only) lets . and [^ match newlines; and strictlimits requires the whole match to lie within index and stopindex. If count is a Variable, the number of index positions in the match is stored in it.
Changed in 3.15
  • 3.15: Added the nolinestop and strictlimits parameters.
0 Examples
No examples for tkinter/Text.search.
See Also
No see-alsos for tkinter/Text.search
0 Notes
No notes for Text.search