Search & Replace Question (Folder-specific operations)

Imagine a folder containing files named Anatomy.php, Habitat.php, Ecology.php, etc. Now imagine copying the folder and giving each copy a unique name - Mammals, Birds, Insects, etc.

Is there a way to do search and replace operations that only target files of the same name? For example, suppose I want to insert some code in every file named Anatomy.php - Birds/Anatomy.php, Mammals/Anatomy.php, etc.

I’m using Dreamweaver on a Mac. I’ve used a text editor to do search and replace operations with regex, though I can’t remember which text editor - probably TextWrangler. (I bought a new Mac laptop recently and haven’t done this operation in a while.)

Anyway, what would be the best way to do folder-specific search & replace operations?

(Sorry, I didn’t know what forum to post this question in so I decided to try here.)