def subn_filter ( s , find , replace , count = 0 ) : return re . gsub ( find , replace , count , s )
replace all occurrence of a searched pattern in python
A non - optimal implementation of a regex filter
def subn_filter(s, find, replace, count=0):
    """A non-optimal implementation of a regex filter"""
    return re.gsub(find, replace, count, s)