<?xml version="1.0"?>
<mx:Application name="lightspark_RegExp_test"
	xmlns:mx="http://www.adobe.com/2006/mxml"
	layout="absolute"
	applicationComplete="appComplete();"
	backgroundColor="white">

<mx:Script>
	<![CDATA[
	import Tests;
	private function appComplete():void
	{
		//Exec tests
		var re:RegExp = new RegExp("(?P<namedCapture>[a-zA-Z_]*)([0-9]+)");
		var ret:Array = re.exec("idenTIfiER_123");
		Tests.assertArrayEquals(["idenTIfiER_123","idenTIfiER_","123"], ret, "exec(): With capturing groups", true);
		Tests.assertEquals("idenTIfiER_", ret.namedCapture, "exec(): With named capturing groups", true);

		var re2:RegExp = new RegExp("[0-9]+");
		var ret2:Boolean = re2.test("aaa012bbb");
		Tests.assertTrue(ret2, "test()");

		Tests.report(visual, this.name);
	}
	]]>
</mx:Script>

<mx:UIComponent id="visual" />

</mx:Application>
