title: Jquery how to get index from input name attribute
body: <p>I have this code which works ok, but i was wondering if it could be done faster with jquery to get the index from input name attribute</p>
  
  <pre><code>&lt;input name="inp[myindex]" value="bla" /&gt;
  </code></pre>
  
  <p>and the jquery</p>
  
  <pre><code>var $idx = $this.attr('name');
  var $split = $idx.split('[');
  $idx = $split[1];
  $idx = $idx.replace(']', '');
  </code></pre>
  
  <p>Thanks in advance!</p>