How can I search and replace in Firefox?

You can use FoxReplace which should do what you want.

This extension allows you to replace text fragments (strings) in a page by other text fragments. The system is based on substitutions, where each substitution has an input text which has to be replaced (the "Replace" field) and an output text by which the first has to be replaced (the "With" field). When a substitution is applied it's over the whole content of a page (you can't do partial substitutions at the moment). Substitutions can be case-sensitive or insensitive. The use of regular expressions is also supported.