import re



def get_filters():
	"""Register a function with decorator"""
	registry = {}
	def registrar(func):
		registry[func.__name__] = func
		return func 
	registrar.all = registry
	return registrar


filter = get_filters()


@filter
def regex_trim(input, regex, replace=''):
	"""
	Trims or replaces the regex match in an input string.
	input (string): the input string to search for matches
	regex (string): regex to match
	replace (string - optional): a string to replace any matches with.  Defaults to trimming the match.
	"""
	return re.sub(regex, replace, input)





if __name__ == '__main__':
	for k,v in filter.all.items():
		print(v)

@@ -10,19 +10,24 @@
 %0A%0A%0A%0Adef 
-get
+register
 _filters
@@ -216,21 +216,123 @@
 r = 
-get_filters()
+register_filters()%0A%0A%0A%0Adef get_jinja_filters():%0A%09%22%22%22Return all registered custom jinja filters%22%22%22%0A%09return filter.all
 %0A%0A%0A@
@@ -675,80 +675,4 @@
 put)
-%0A%0A%0A%0A%0A%0Aif __name__ == '__main__':%0A%09for k,v in filter.all.items():%0A%09%09print(v)%0A

add method to return filters