import re


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)