How can I search and replace in Firefox?

5

2

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.

Raphael

Posted 2012-08-18T19:19:25.243

Reputation: 305

Note: gedit got Search & Replace in the meantime [ see ].

– tanius – 2015-07-01T06:36:42.757

1

Copy-paste into an editor is what I do. There's It's all text to make this more automated.

– Gilles 'SO- stop being evil' – 2012-08-18T19:26:24.633

@Gilles Interesting. Does it pull the result back, too? – Raphael – 2012-08-18T19:44:44.687

1It creates a temporary file and synchronizes back and forth every few seconds. – Gilles 'SO- stop being evil' – 2012-08-18T19:50:03.143

@Gilles I think that's worth an answer as an editor might provide extra comfort (for settings where a good editor is available). – Raphael – 2012-08-18T20:05:13.903

I was going to, but you explicitly requested a solution that doesn't use an external text editor. – Gilles 'SO- stop being evil' – 2012-08-18T20:15:36.533

Answers

5

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.

user35787

Posted 2012-08-18T19:19:25.243

Reputation:

0

For full Regular Expression support and advanced substitution patterns (e.g. $1, $2, &$) you might want to check out this Chrome find & replace extension:

https://chrome.google.com/webstore/detail/find-replace-for-text-edi/jajhdmnpiocpbpnlpejbgmpijgmoknnl

Dali

Posted 2012-08-18T19:19:25.243

Reputation: 1

1This is a link only answer, please tell the user how to use the extension and why you think it is the best option – TomEus – 2017-10-30T18:56:27.983

0

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 …

tanius

Posted 2012-08-18T19:19:25.243

Reputation: 515

FYI, it's not compatible with the current version of Firefox (61.0.1 at time of posting). The last time the plugin was updated was 2012-12-18. – PeterFnet – 2018-07-16T20:08:00.427