title: How do I match a number inside square brackets with regex
body: <p>I wrote a regular expression which I expect should work but it doesn't.</p>
  <pre><code>var regex = new RegExp('(?&lt;=\[)[0-9]+(?=\])')
  </code></pre>
  <p>JavaScript is giving me the error：</p>
  <blockquote>
  <p>Invalid regular expression :(/(?&lt;=[)[0-9]+(?=])/): Invalid group</p>
  </blockquote>
  <p>Does JavaScript not support lookahead or lookbehind?</p>