function escapeRegexp(queryToEscape) {
    return ('' + queryToEscape).replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
  }
Highlights text that matches $select.search.

Taken from AngularUI Bootstrap Typeahead
See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L340