<p>In javascript, I've got a block of HTML like this:</p>

<pre><code>&lt;h2&gt;{title}&lt;/h2&gt;
&lt;p&gt;&lt;a href="{url}"&gt;{content}&lt;/a&gt;&lt;/p&gt;
</code></pre>

<p>And I'm trying use regex "match" to spit out an array of all the {item}'s. So my output should look like:</p>

<pre><code>['title', 'url', 'content']
</code></pre>

<p>I've gotten as far as:</p>

<pre><code>var pattern = new RegExp("\{[a-zA-Z]+\}+");
var match = pattern.exec("{Sample} bob {text}");
</code></pre>

<p>But it's only returning the first tag. </p>

<p>This is just beyond my regex skills. Can anyone help?</p>

<p>Cheers!</p>

I think you want:
```
```
var pattern = new RegExp("\{[a-zA-Z]+\}+", "g");
```
```
The second option is a flag telling it to search the entire string and return all matches.
See:
http://www.evolt.org/article/Regular_Expressions_in_JavaScript/17/36435/
for more details.