I am using egrep -R followed by a regular expression containing about 10 unions, so like:
.jpg | .png | .gif etc. This works well, now I would like
I couldn't get any of the commands on this page to work for me: the sed solution added a newline to the end of all the files it processed, and the perl solution was unable to accept enough arguments from find. I found this solution which works perfectly:
find . -type f -name '*.[hm]' -print0
| xargs -0 perl -pi -e 's/search_regex/replacement_string/g'
This will recurse down the current directory tree and replace search_regex with replacement_string in any files ending in .h or .m.
I have also used rpl for this purpose in the past.