Regular expression [Any number]
<p>I need to test for "[any number]" in a string in javascript. how would i match it?</p>

<p>Oh, "[" and "]" also need to be matched. </p>

<p>so string like "[1]" or "[12345]" is a match.</p>

<p>Non match: "[23432" or "1]" </p>

<p>So for example:</p>

<pre><code>$('.form .section .parent').find('input.text').each(function(index){
      $(this).attr("name", $(this).attr("name").replace("[current]", "['"+index+"']"));
});
</code></pre>

<p>I need to replace input fields name: "items[0].firstname" to "items[1].firstname"
thanks</p>
