def find_functions(file_name, data, db_cursor, functions):
	""" finds all functions in asp script """
	my_re = re.compile(r'[^\'\"][ ]{0,10}function[ ]{1,3}(?P<fun>[a-z0-9_\-]{1,30})', re.IGNORECASE)
	res = my_re.findall(data)
	if res:
		for line in res:			
			print "function", line.lower()
			tmp = file_name + '\t\t' + line.lower()		#(file_name, line)
			functions.append(tmp)			
			db_cursor.execute("""insert into project_functions
					values ((SELECT max(id) FROM project_functions)+1, '%s', '%s', 'function')""" % (file_name, line.lower()))			

	my_re = re.compile(r'[^\'\"][ ]{0,10}sub[ ]{1,3}(?P<fun>[a-z0-9_\-]{1,30})', re.IGNORECASE)
	res = my_re.findall(data)
	if res:
		for line in res:			
			print "sub", line.lower()
			#tmp = (file_name, line)
			tmp = file_name + '\t\t' + line.lower()		#(file_name, line)
			functions.append(tmp)
			db_cursor.execute("""insert into project_functions
					values ((SELECT max(id) FROM project_functions)+1, '%s', '%s', 'sub')""" % (file_name, line.lower()))
 finds all functions in asp script 
recipes/Python/576510_Classic_ASP_script_analyzer_finds_all_functions_/recipe-576510.py