call strip s of the surrounding whitespaces, substitute every occurrence of the whitespace in the trim_whitespace_re with previous result, return the result.
return trim_whitespace_re . sub ( ' ' , s . strip ( ) )