Search forward from index1 (up to index2 if given) for the first range of characters tagged with tagName, and return a two-element tuple of its start and end indices, or an empty tuple if there is no such range.
tkinter/Text.tag_nextrange
Text.tag_nextrange