3 import flash.display.MovieClip
5 public class Main extends flash.display.MovieClip {
6 public function Main() {
8 var r:RegExp = /ok \d\/\d/;
9 trace("ok 1/7".match(r));
12 var s:String = "error OK 9/7 ok 2/7"
13 trace(s.substring(s.search(r)));
15 /* test /.../i syntax */
16 var r2:RegExp = /ok \d\/\d/i;
17 var s2:String = "error OK 3/7"
18 var s3:String = "error ok 3/7"
19 trace(s3.substring(s2.search(r2)));
22 if(" .\n\r\t".search(/[\n][\r][\t]/) == 2) trace("ok 4/7");
24 /* test * at end of regexp */
25 if(" xxx ".search(/xx*/) == 2) trace("ok 5/7");
28 if(" \" ".search(/"/) == 1) trace("ok 6/7");
29 if(' \' '.search(/'/) == 1) trace("ok 7/7");