title: AS3: RegEx getting words inbetween square brackets
body: <p>I'm trying to create a text parser in AS3, that finds words in [square brackets] and replaces them with another set of words. So far, I've managed to create the actual RegEx style, but it keeps spitting out two words-- one in the brackets, and one without. Likewise, I cant manage to make it run continously until the whole sentence has been parsed, and resulter comes out null.</p>
  
  <pre><code>public function parseWords(words):String {
          var replacer:String = words;
          var finder:RegExp =  new RegExp("\\[([a-zA-Z0-9]+)\\]");
          var resulter:Object = finder.exec(words);
          trace(resulter[0] == "[Rabbit]");
          //trace (replacer);
          trace (resulter);
          return replacer;
      }
  </code></pre>
  
  <p>Trace results;
  true    [Rabbit],Rabbit</p>
  
  <p>Any ideas?</p>