A lot of Mac users have become familiar with a powerful text editor in the form of TextMate. It combines some of the power that is Unix with some of the cleaness that is OSX to give you an editor that could replace some IDEs. It has code snippets and macros made available via bundles that have been created by the community and cover over 30 different languages. You can use it for Flash development, even issuing “Test Movie” commands from TextMate. I’ve personally used it for managing Flex projects for external client projects thanks to its ANT and SVN integration.
Today though, I want to share a hidden little gem that most may be overlooking and that’s the Regular expression option on the Find/Replace interface. Just the other day, I was building a webservice based off of 1500+ records that were originally formatted in PHP but now needed to be converted to an ActionScript friendly format. Enter TextMate. With the records open in TextMate, I hit Cmd + F and entered the expressions shown in the following screenshot, selected the Regular expression option then clicked the Replace All button and presto, chango!! In a matter of seconds 1500+ records were man-handled with ease.

The first expression is the pattern that I’m searching for and the second expression says on each match found, take the first and second values and place them inside this pattern. TextMate is definitley very versatile and a joy to use!


