Can any RegEx genius :) tell me whether ActionScript 3 properly
supports multiple backreferences? The code I'm trying to use is this:

                        private var headerBackreference:RegExp = 
/<H([123])>.*?<\/H\1>/;
                        private function init():void {
                                var s:String = "<BODY><H2>Valid Chocolate</H2> 
<H2>Valid
Vanilla</H2> <H2>Invalid HTML</H3></BODY>";
                                var a:Array = headerBackreference.exec(s) as 
Array;
                                if(a != null) {
                                        for(var i:int = 0; i<a.length; i++) {
                                                trace(a[i]);
                                        }
                                }
                                a = s.match(headerBackreference);
                                if(a != null) {
                                        for(var i:int = 0; i<a.length; i++) {
                                                trace(a[i]);
                                        }
                                }
                        }


I'm just trying to determine whether in fact this should return both
the chocolate and the vanilla, or whether the behavior I see,
returning just chocolate, is accurate. Thanks,

Josh

Reply via email to