 <p><a href="http://jsfiddle.net/mE7EQ/" rel="nofollow">http://jsfiddle.net/mE7EQ/</a></p> <p>I wrote one up real quick, if you have any questions about it, let me know!</p> <pre><code>var a = 'This is some [example] text for my javascript [regexp] [lack] of knowledge.' var results = a.match(/\[\w*\]/g); alert(results[0] + ' ' + results[1] + ' ' + results[2]); </code></pre>