libs/tkinter_extension.py
def highlight_pattern(self, pattern, tag, start="1.0", end="end",
						  regexp=False):
		'''Apply the given tag to all text that matches the given pattern

		If 'regexp' is set to True, pattern will be treated as a regular
		expression according to Tcl's regular expression syntax.
		'''
		start = self.index(start)
		end = self.index(end)
		self.mark_set("matchStart", start)
		self.mark_set("matchEnd", start)
		self.mark_set("searchLimit", end)

		count = IntVar()

		while True:
			index = self.search(pattern, "matchEnd","searchLimit",
								count=count, regexp=regexp)
			if index == "": break
			if count.get() == 0: break # degenerate pattern which matches zero-length strings
			real_index = index.split('.')
			start_pos = index
			end_pos = str(real_index[0]) + '.' + str(int(real_index[1]) + count.get())
			self.mark_set("matchStart", str(start_pos))	
			self.mark_set("matchEnd", str(end_pos))
			#self.mark_set("matchStart", str('1.'+ str(start_pos)))
			#self.mark_set("matchEnd", "%s+%sc" % (index, count.get()))
			self.tag_add(tag, "matchStart", "matchEnd")
Apply the given tag to all text that matches the given pattern

		If 'regexp' is set to True, pattern will be treated as a regular
		expression according to Tcl's regular expression syntax.
		
Apply the given tag to all text that matches the given pattern
If 'regexp' is set to True, pattern will be treated as a regular
expression according to Tcl's regular expression syntax.
Apply the given tag to all text that matches the given pattern If ' regexp ' is set to True pattern will be treated as a regular expression according to Tcl ' s regular expression syntax .
def highlight_pattern(self, pattern, tag, start="1.0", end="end",
						  regexp=False):
		start = self.index(start)
		end = self.index(end)
		self.mark_set("matchStart", start)
		self.mark_set("matchEnd", start)
		self.mark_set("searchLimit", end)
		count = IntVar()
		while True:
			index = self.search(pattern, "matchEnd","searchLimit",
								count=count, regexp=regexp)
			if index == "": break
			if count.get() == 0: break 
			real_index = index.split('.')
			start_pos = index
			end_pos = str(real_index[0]) + '.' + str(int(real_index[1]) + count.get())
			self.mark_set("matchStart", str(start_pos))	
			self.mark_set("matchEnd", str(end_pos))
			self.tag_add(tag, "matchStart", "matchEnd")
def highlight_pattern ( self , pattern , tag , start = "1.0" , end = "end" , regexp = False ) : start = self . index ( start ) end = self . index ( end ) self . mark_set ( "matchStart" , start ) self . mark_set ( "matchEnd" , start ) self . mark_set ( "searchLimit" , end ) count = IntVar ( ) while True : index = self . search ( pattern , "matchEnd" , "searchLimit" , count = count , regexp = regexp ) if index == "" : break if count . get ( ) == 0 : break real_index = index . split ( '.' ) start_pos = index end_pos = str ( real_index [ 0 ] ) + '.' + str ( int ( real_index [ 1 ] ) + count . get ( ) ) self . mark_set ( "matchStart" , str ( start_pos ) ) self . mark_set ( "matchEnd" , str ( end_pos ) ) self . tag_add ( tag , "matchStart" , "matchEnd" )
Apply the given tag to all text that matches the given pattern
If 'regexp' is set to True, pattern will be treated as a regular
expression according to Tcl's regular expression syntax.
Apply the given tag to all text that matches the given pattern If ' regexp ' is set to True pattern will be treated as a regular expression according to Tcl ' s regular expression syntax .
'''Apply the given tag to all text that matches the given pattern

		If 'regexp' is set to True, pattern will be treated as a regular
		expression according to Tcl's regular expression syntax.
		''' # degenerate pattern which matches zero-length strings #self.mark_set("matchStart", str('1.'+ str(start_pos))) #self.mark_set("matchEnd", "%s+%sc" % (index, count.get()))
self
pattern
tag
start
end
regexp