Using Autocomplete: Any way to ignore "space"

Using Autocomplete: Any way to ignore "space"

I have a long list of web links, and a search field that allows users to search them. The user starts typing into a search field, and the form uses jquery ui autocomplete to instantly display the list of matching links. They can click a result and instantly be taken to the site.

The problem is, if they type a "space" first, it renders every single link whose label contains a space in it.

Is there any way to construct this so spaces entered are ignored?

Example code:

$(function() {
   var availableTags = [
{label:"Microsoft MSN", the_link:"http://www.msn.com"},
{label:"Google News", the_link:"http://news.google.com"},
{label:"Yahoo!", the_link:"http://www.yahoo.com"}];
    $( "#tags" ).autocomplete({
      source: availableTags,
      select:function(e,ui) { 
      location.href = ui.item.the_link;
    //  console.log(ui.item.the_link);
      }
    });
});


Thanks!!