The search operation scans the text widget for a string that matches a pattern. The index of the text that matches the pattern is returned. The search starts at an index and covers all the text widget unless a stop index is supplied. You can use end as the stop index to prevent the search from wrapping back to the beginning of the document. The general form of the search operation is this:
$t search ?options? pattern index ?stopIndex?
Table 33-4 summarizes the options to the search operation:
|-forward||Searches forward from index. This is the default.|
|-backward||Searches backward from index.|
|-exact||Matches pattern exactly. This is the default.|
|-regexp||Uses regular expression pattern matching. ...|