Create a global regular expression that matches three-letter words
package{
import flash.display.Sprite;
publicclass Main extends Sprite{
public function Main(){
var regex:RegExp = /\b[a-z]{3}\b/g;
var sentence:String = "This string has two three letter words.";
trace( sentence.search( regex ) );
trace( regex.lastIndex );
trace( sentence.search( regex ) );
}
}
}