Do any OS X apps ease Search and Replace across multiple files?

I'm looking for an OS X tool which allows me to search and replace a search string in multiple files. The requirements are the following:

  • Search and Replace
  • Search by regular expression
  • Search across multiple files
  • Search across nested directory structures
  • Replace expression can use values from the search (Regular Expression)
  • The tool has an easy to use user interface
  • Preferably free

I know that some text editors like BBEdit have this functionality, but I would prefer a lightweight tool that doesn't require me to open the files for editing first.

If there aren't any tools to match these requirements, I would also consider a command line alternative. I know that perl and sed support something like this - a solution that I can define either as a Bash alias or function would be welcome in this case.


Solution 1:

I typically use TextMate:

TextMate Search and Replace dialog

TextMate (1) is/was a buy product, but TextMate 2 is currently under active openSource development on gitHub and free to use.

Solution 2:

Sublime Text is what I use, it's great!

screenshot of find and replace

Sublime Text:

  • is free to evaluate (no time limit imposed)
  • can search and replace
  • can search by regular expression
  • can search across multiple files
  • can search across nested directory structures
  • can use values from the search in replace expression
  • has an easy to use user interface

Solution 3:

You don't have to open the files with BBEdit. You just point it to a folder. It's a very powerful tool, one that I've often used with large numbers of HTML files.