It's pretty comfortable to search and replace text in files using perl and regular expressions. Using one single command we can search, replace and create backups of all the files at once.
Let's create a file first:
echo "perl is Kewl" >> regtext.txt;
Now let's do the trick:
perl -p -i.bak -e 's/k|Kewl/cool/g' regtext.txt
This command will search for Kewl in regtext.txt and will replace it with cool and it will create a backupfile called regtext.txt.bak.