How to increment number in string using Javascript or Jquery
<p>The id of my textarea is string  and of this format</p>

<blockquote>
  <p>id='fisher[27].man'</p>
</blockquote>

<p>I would like to clone the textarea and increment the number and get the id as <code>fisher[28].man</code> and prepend this to the existing textarea.</p>

<p>Is there a way to get this done easily with jquery?</p>

<pre><code>var existingId = $("#at textarea:last").attr('id');
var newCloned = lastTextArea.clone();
var newId = newCloned.attr('id');
//add the index number after spliting
//prepend the new one to 
newCloned.prepend("&lt;tr&gt;&lt;td&gt;" + newCloned + "&lt;/td&gt;&lt;/tr&gt;");
</code></pre>

<p>There has to be easier way to clone, get index number, split and prepend. </p>

<p>I'm  have also tried to do this with regEx </p>

<pre><code>var existingIdNumber = parseInt(/fisher[(\d+)]/.exec(s)[1], 10);
</code></pre>

<p>Can anybody help me with this? </p>
