title: jquery get value in brackets using regex
body: <p>This has probably been asked a million times, and i am probably way off in what i have below, but i can not find it anywhere on SO.  I need to get my alert below to show the value inside the brackets.</p>
  
  <pre><code>//the element(thisId) holds the following string:   id[33]     
  var thisId = $(this).attr('id');
  var idNum = new RegExp("\[(.*?)\]");
  alert(idNum);
  </code></pre>
  
  <p>I need the alert to show the value <code>33</code>.</p>