Create a global regex to match multiple times in a string
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ var example:RegExp = /abc/g; var result:Array = example.exec( "abc abc" ); trace( result.index ); trace( example.lastIndex ); } } }