def filter_re_replace(val, pattern, repl):
 return re.sub(pattern, repl, str(val))

def filter_re_replace ( val , pattern , repl ) : return re . sub ( pattern , repl , str ( val ) )
perform a regexp replacement on the given string .