title: Javascript - return string between square brackets
body: <p>I need to return just the text contained within square brackets in a string. I have the following regex, but this also returns the square brackets:</p>
  
  <pre><code>var matched = mystring.match("\\[.*]");
  </code></pre>
  
  <p>A string will only ever contain one set of square brackets, e.g.:</p>
  
  <pre><code>Some text with [some important info]
  </code></pre>
  
  <p>I want matched to contain 'some important info', rather than the '[some important info]' I currently get.</p>