Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am moderator on a site with lots of structured content and regularly edit posts for poor formatting (in particular Markdown and LaTeX). Many of those tasks are tedious and could easily be performed by a search & replace function which, sadly, my browser of choice Firefox lacks.

I could not find a suitable plugin (although I admittedly did not check all >900 results) which is surprising; this seems to easy and useful a feature to not have a plugin!

Copying posts into a text editor is a nice workaround in some cases, but not in all. Some text editors don't have search ^ replace (e.g. gedit, default editor for many GTK based Linux distributions), and I might not be able to install one on every machine I use SE on (university, friends, ...).

Is there a way to bring search & replace to Firefox, preferably with regexp support?

My OS is GNU/Linux, more specifically Ubuntu.

share|improve this question
Copy-paste into an editor is what I do. There's It's all text to make this more automated. – Gilles Aug 18 '12 at 19:26
@Gilles Interesting. Does it pull the result back, too? – Raphael Aug 18 '12 at 19:44
It creates a temporary file and synchronizes back and forth every few seconds. – Gilles Aug 18 '12 at 19:50
@Gilles I think that's worth an answer as an editor might provide extra comfort (for settings where a good editor is available). – Raphael Aug 18 '12 at 20:05
I was going to, but you explicitly requested a solution that doesn't use an external text editor. – Gilles Aug 18 '12 at 20:15
up vote 5 down vote accepted

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.

share|improve this answer

You can also use Search and Replace for Firefox, which closely resembles the typical "Search & Replace" function in editors:

A simple addon that enables you to find and replace text on the webpage you are currently on. To access the replace form either use your right click context menu or the keyboard shortcut shift + R. You can either replace one instance or all instances of a text phrase. […]

FoxReplace, on the other hand, is a full-fledged filter that you can also apply to automatically process URL-specific replace rules on page load. Including translating UI elements that are not translated server-side. It also works for simple Search & Replace, but might be a bit overkill.

However, it seems neither Search and Replace for Firefox nor FoxReplace are capable of regexp search and replace …

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .