« Looks like June might be here | Main | Dynamic Interface »

Regular Expressions

I've been playing around with Flex 2 for some time at work. One of the neat things that Actionscript 3 adds is native regular expressions. As part of an ongoing effort to share knowledge I volunteered to give an informal talk about regular expressions. To help with the talk I created this visual regular expression viewer. It helps show you what matched along with any groupings and other standard stuff. Additionally it can also perform a regular expression replace operation or a simple split operation.

You will need the Flash 9 in order to run the application.

Launch RegExp Tester!

If you find any bugs, have comments, etc. please leave me a comment.

Tags: actionscript as3 programming regexp regularexpression

Comments

Hi, I can't launch your regexp tester with flash9: ReferenceError: Error #1069: Property hasDefinition not found on flash.system.ApplicationDomain and there is no default value. at mx.managers::SystemManager/getDefinitionByName() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::addingChild() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt() at mx.managers::SystemChildrenList/addChild() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize() at mx.managers::SystemManager/::initHandler()
Getting an error... ReferenceError: Error #1069: Property hasDefinition not found on flash.system.ApplicationDomain and there is no default value.
Looks like the Flash player changed a little in some of the latest betas. I've recompiled the SWFs with an older version that seems to work. Let me know if it still has problems.
cool app, but there's no form labels to identify what each field does. Can you give a brief explanation of the tester and what each field means. Which field is the test string and which is the expression tested? I've got a list of items In an array, curently delim by a | pipe so I can do an OR re - however I now realize I need to do an OR and have a distinct match. men|women|daily|wheelchair ... Any suggestions here? // filters designations private function desFilterFunc(item:Object):Boolean { var testStr:String = item.designations; var cond:Boolean; // args is global list delim by "|" (or) set by calling function var pattern1:RegExp = new RegExp(args,'gi'); //global, ignore case cond = pattern1.test(testStr); // returns: true return cond; } I need to match men not men or women