Friday, October 30, 2009

Textmate Regular Expression Search and Replace

I use and love the text editor Textmate, which has some powerful functions. One thing that it can help with is quickly editing text files, and for example today I used it for searching lines in a mail system's "aliases" file. I wanted to remove 50-odd lines with the word owner in them, so I used the Find command with Regular Expression checked.

The search string is:

^.*owner.*$

If you enter that string which means to find the lines with owner in them, check "Regular Expression," and leave a blank in the Replace box, Textmate will blank out the lines for you. Convenient!

1 comment:

Rick Cogley said...

Don't spam my blog, Eda. This has nothing to do with SMS.