title: Regular expression to pull the inner content from a WordPress shortcode
body: <p>I have a WordPress shortcode that opens with a <code>[pullquote]</code> and ends with <code>[/pullquote]</code>. I'm trying to get whatever is inside of the opening and closing tags.</p>
  <p>I'm new to regular expressions so I stared with a simple one that captures letters, numbers and spaces.</p>
  <p><code>\[pullquote\]([0-9a-zA-z\s]*)\[\/pullquote\]</code></p>
  <p>That works fine but doesn't account for punctuation etc. so I tried <code>(.*)</code> which was doing too much and not nearly specific enough.</p>
  <p><strong>Finally I tried this</strong></p>
  <p><code>\[pullquote\](^(?:\[\/pullquote\])*)\[\/pullquote\]</code></p>
  <p>I'm not clear on the terminology here but essentially wanted to get anything that started with <code>[pullquote]</code> captured whatever came after that provided it wasn't <code>[/pullquote]</code> and ended with <code>[/pullquote]</code>.</p>
  <p>At least on <a href="http://regexr.com" rel="nofollow noreferrer">regexr.com</a> it didn't work but I assume that means I did something wrong.</p>
  <p><strong>Text used on regexr</strong></p>
  <pre><code>[pullquote]Something[/pullquote]
  [pullquote]Something else.[/pullquote]
  </code></pre>
  <p>How can I make this work and am I doing anything else wrong here.</p>
  <p>Thanks</p>