title: How do I match a string between characters in javascript regex
body: <p>I'm trying to match just the characters <em>between</em> some set characters using regex? I'm very new to this but I'm getting somewhere...</p>
  
  <p>I want to match all instances of text between '[[' and ']]' in the following string:</p>
  
  <p>'Hello, my [[name]] is [[Joffrey]]'.</p>
  
  <p>So far I've been able to retrieve <code>[[name</code> and <code>[[Joffrey</code> with the following regex:</p>
  
  <pre><code>\[\[([^\]])*\g
  </code></pre>
  
  <p>I've experimented with grouping etc but can't seem to get the 'contents' only (<code>name</code> and <code>Joffrey</code>).</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>