<p>Is there a simple and lightweight program to search over a text file and replace a string with regex?</p>

For searching:
grep
- simple and fast. Included with Linux,
here
's a Windows version, not sure about Mac.
For replacing:
sed
.
Here
's a Windows version, not sure about Mac.
Of course, if you want to actually open up a file and see its contents while you search and replace, you can use
emacs
for that. Or
ConTEXT
. Or
vim
. Or what have you. ;)
See also
this question
.