def _remove_whitespace(s, regex=_RE_WHITESPACE):
return regex.sub('<STR_LIT:U+0020>', s.strip())<EOL>
Replace extra whitespace inside of a string with a single space.

    Parameters
    ----------
    s : str or unicode
        The string from which to remove extra whitespace.

    regex : regex
        The regular expression to use to remove extra whitespace.

    Returns
    -------
    subd : str or unicode
        `s` with all extra whitespace replaced with a single space.