rem: s = s.replace(/\s+/g, '-'); 
add: s = s.replace(/[-\s]+/g, '-'); 
context: function URLify(s, num_chars) {    // changes, e.g., "Petty theft" to "petty_theft"    // remove all these words from the string before urlifying    removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from",                  "is", "in", "into", "like", "of", "off", "on", "onto", "per",                  "since", "than", "the", "this", "that", "to", "up", "via",                  "with"];    r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');    s = s.replace(r, '');    s = s.replace(/[^-A-Z0-9\s]/gi, '');  // remove unneeded chars    s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces    s = s.replace(/\s+/g, '-');      // convert spaces to hyphens    s = s.toLowerCase();             // convert to lowercase    return s.substring(0, num_chars);// trim to first num_chars chars}
meta: 779	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/779/51f6a9442c21d6288ccca9b8d9ebaf2f6ecd5b9d/urlify.js/buggy/django/contrib/admin/media/js/urlify.js