Thursday, August 27, 2009

Regular Expressions in AS3

Lately, I've been using more Regular Expressions in JavaScript and ActionScript 3.0. projects. In AS3, RegExp can be useful for validating user entries or searching for matches. I found that you can test your the RegExp patterns using DreamWeaver's Find and Replace dialog by checking the "Use regular expression" option.

Tonight I built a RegExp Tester in Flash that kind of does the same thing. I'm sure it needs more tweaking to get better results and display the results more cleanly. You can test RegExp here:

http://www.jazzairwaves.com/Flash/RegExp/

The Regular Expressions Cookbook by Jan Goyvaerts and Steven Levithan, published by O'Reilly, offers great details on the subject.

I'm sure that becoming proficient at regex will improve my coding for text search and validation. Does it also increase my geek score? Yeah.

Aloha, Joe

No comments:

Post a Comment