title: Adding limit to regexp constructor
body: <p>How can I limit this regexp to be applied to characters 0 to 15?:</p>
  
  <pre><code>function __highlight(s, t) {
    var xm = new RegExp("("+$.ui.autocomplete.escapeRegex(t)+")", "ig" );
    return s.replace(xm, "&lt;span style='color:red; text-decoration: underline; font-weight: bold;'&gt;$1&lt;/span&gt;");
  }
  </code></pre>
  
  <p>to match characters from 0 to 15?</p>
  
  <p>tried <code>var matcher = new RegExp("("+$.ui.autocomplete.escapeRegex(t)+")", "ig/^{0,15}*$/" );</code></p>
  
  <p>But its throwing an error. </p>
  
  <p>The regexp is being called here:</p>
  
  <pre><code>.autocomplete( "instance" )._renderItem = function( ul, item ) {
      return $( "&lt;li&gt;&lt;/li&gt;" )
      .data( "item.autocomplete", item )
      //.append( "&lt;a&gt;" + "&lt;img src='" + item.imgsrc + "' /&gt;" + item.id+ " - " + item.label+ "&lt;/a&gt;" )
      // Appen d item.info from query to whow what column we have matched
      .append(__highlight(item.label + ' ' + item.info, this.term))
      .appendTo( ul );
  </code></pre>