title: Regular expression to extract text between square brackets
body: <p>Simple regex question. I have a string on the following format:</p>
  
  <pre><code>this is a [sample] string with [some] special words. [another one]
  </code></pre>
  
  <p>What is the regular expression to extract the words within the square brackets, ie.</p>
  
  <pre><code>sample
  some
  another one
  </code></pre>
  
  <p>Note: In my use case, brackets cannot be nested.</p>