Here is a basic plugin that will cycle through all instances of the regex pattern defined at regexQuery

import sublime, sublime_plugin
class SelectQueryCommand( sublime_plugin.TextCommand ):
def run( self, edit ):
#■■■ Set Position To Search From ■■■#
selections = self.view.sel()
if len( selections ) == 0:
searchPoint = 0
else:
searchPoint = selections[0].b
#■■■ Find Query From Current Selection To End Of Document ■■■#
regexQuery = "\\bfunction\\b"
searchResult = self.view.find( regexQuery, searchPoint )
#■■■ Select Queried Region ■■■#
if searchResult:
self.select_Region( searchResult )
#■■■ If No Match Was Found, Find Query From Start Of Document ■■■#
else:
searchPoint = 0
searchResult = self.view.find( regexQuery, searchPoint )
if searchResult:
self.select_Region( searchResult )
#■■■ Select Result Region ■■■#
def select_Region( self, region ):
self.view.selection.clear()
self.view.selection.add( region )