# Plugin: Search and Replace

**URL:** <https://discourse.joplinapp.org/t/plugin-search-and-replace/29242>\
**Category:** Plugins\
**Created:** [24 January 2023 12:43 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242 "2023-01-24T12:43:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [24 January 2023 12:43 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/1 "2023-01-24T12:43:29Z")

</div>

This plugin adds a simple "Search & Replace" function to the Markdown editor.

![grafik](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/6/167c28d5849f4c022186eea98096476525aee3ad.png)

> **[GitHub - FelisDiligens/joplin-plugin-search-and-replace: Adds a simple search...](https://github.com/FelisDiligens/joplin-plugin-search-and-replace)**
>
> Adds a simple search and replace dialog. Contribute to FelisDiligens/joplin-plugin-search-and-replace development by creating an account on GitHub.

A lot of users (myself included) have been looking for a way to search and replace text within Joplin, instead of relying on an external editor (such as VSCode). See [this forum post](https://discourse.joplinapp.org/t/find-and-replace/7283).

I hope, this will be useful for some of you. I'd love to hear feedback, questions, and bug reports.

Cheers! \<3

---

<div class="post-metadata">

**Author:** ![stevemagruder](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/stevemagruder/32/16490_2.png) [@stevemagruder](https://discourse.joplinapp.org/u/stevemagruder)\
**Post date:** [24 January 2023 13:36 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/2 "2023-01-24T13:36:25Z")

</div>

Thank you for creating this.

I have installed it into my Joplin on Windows but I can't figure out where it is. Old eyes, maybe.

On edit: I see it now - I have to switch to the markdown editor first. I usually use the wysiwyg editor.

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [24 January 2023 14:09 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/3 "2023-01-24T14:09:01Z")

</div>

Ok so... I just found out that the WYSIWYG editor actually has a built-in "Find and Replace" (`Ctrl`+`F`):  
 ![grafik](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/4/1/41a2dda43525b2b667c8dd58d8cdd47bdc4117c7.png)  
At least in Joplin Pre-release.

---

<div class="post-metadata">

**Author:** ![stevemagruder](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/stevemagruder/32/16490_2.png) [@stevemagruder](https://discourse.joplinapp.org/u/stevemagruder)\
**Post date:** [24 January 2023 14:33 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/4 "2023-01-24T14:33:15Z")

</div>

Cool. But at least yours has regular expressions, and that can really be useful at times.

---

<div class="post-metadata">

**Author:** ![johano](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/johano/32/1053_2.png) [@johano](https://discourse.joplinapp.org/u/johano)\
**Post date:** [24 January 2023 17:46 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/5 "2023-01-24T17:46:16Z")

</div>

@FelisDiligens, many folk never use the WYSIWYG editor, and your plugin for the Markdown Editor will still be important to them 🙂

---

<div class="post-metadata">

**Author:** ![whitewall](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/whitewall/32/6018_2.png) [@whitewall](https://discourse.joplinapp.org/u/whitewall)\
**Post date:** [25 January 2023 02:42 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/6 "2023-01-25T02:42:41Z")

</div>

Thanks! This is a great, and long overdue, addition to Joplin. I appreciate you taking it on.

---

<div class="post-metadata">

**Author:** ![sneira](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/sneira/32/8718_2.png) [@sneira](https://discourse.joplinapp.org/u/sneira)\
**Post date:** [28 January 2023 07:27 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/7 "2023-01-28T07:27:44Z")

</div>

Thank you for this! The Markdown editor really needed this function.

I do have couple of suggestions based on how the search and replace works in other text editors:

- A "Find Next" button to highlight the next match (so that the user can review it and decide to replace it or skip it).
- The ability to start replacing from the beginning of the note after reaching the end.

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [9 February 2023 12:44 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/8 "2023-02-09T12:44:21Z")

</div>

@sneira Thanks for the feedback!

@all So I decided to rewrite the plugin and use a panel instead of a dialog. I took some inspiration from the "Find and Replace" in Visual Studio Code and Notepad++. This is the result:

![](https://raw.githubusercontent.com/FelisDiligens/joplin-plugin-search-and-replace/master/assets/demo.gif)

As always, questions and feedback are welcome. 🙂

~ Cheers

---

<div class="post-metadata">

**Author:** ![fedwards01](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/fedwards01/32/5103_2.png) [@fedwards01](https://discourse.joplinapp.org/u/fedwards01)\
**Post date:** [9 February 2023 18:04 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/9 "2023-02-09T18:04:15Z")

</div>

I keep the markdown editor and render pane open side by side.

When this opens in a panel it squishes things horribly.

I'm not sure how many people do the same, but I want to cast my vote for you going back to a dialogue.

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [9 February 2023 18:23 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/10 "2023-02-09T18:23:54Z")

</div>

Hi @fedwards01,  
noted. I might think about adding an option to pick between a panel and a dialog. 🙂

Have you tried resizing the panel and pressing `F10` and/or `F11`? This should give you more space when writing.

---

<div class="post-metadata">

**Author:** ![fedwards01](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/fedwards01/32/5103_2.png) [@fedwards01](https://discourse.joplinapp.org/u/fedwards01)\
**Post date:** [9 February 2023 18:39 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/11 "2023-02-09T18:39:18Z")

</div>

Oh, there's always ways around things, but then it's not MY preference, right? 😉

it is simply a request/vote and to make you aware there may be people like me out there. Ultimately it's your time and effort... so your preferences and how much you can accommodate others with what time you have at hand will have to win. 🙂

Thanks for the quick response though!! 👍🏼

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [10 February 2023 08:07 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/12 "2023-02-10T08:07:29Z")

</div>

Hi again,

you can now pick between panel and dialog in the settings:  
 ![Joplin_PdrDc22vsn](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/2/4/2456706bb8c677366554ed2e57538a4e4b5624ff.gif)

The dialog looks like this now:  
 ![](https://github.com/FelisDiligens/joplin-plugin-search-and-replace/raw/master/assets/screenshot-dialog.png)

The functionality is identical to the panel.

~ Cheers 😉

---

<div class="post-metadata">

**Author:** ![fedwards01](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/fedwards01/32/5103_2.png) [@fedwards01](https://discourse.joplinapp.org/u/fedwards01)\
**Post date:** [10 February 2023 13:56 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/13 "2023-02-10T13:56:14Z")

</div>

Perfect! The cats meow! 🤌🏼

---

<div class="post-metadata">

**Author:** ![jovandeginste](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jovandeginste/32/3268_2.png) [@jovandeginste](https://discourse.joplinapp.org/u/jovandeginste)\
**Post date:** [13 February 2023 09:46 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/14 "2023-02-13T09:46:39Z")

</div>

Thanks for this plug-in!  
I wanted to remove all trailing spaces using regex:  
 ![afbeelding](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/a/1a3528b4665b3d3acfd0b7574e4bee71099bb22c.png)

This does not find any result, while there surely were trailing spaces.  
Am I missing something?

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [13 February 2023 09:59 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/15 "2023-02-13T09:59:35Z")

</div>

@jovandeginste The `$` matches the end of the note, instead of the end of the line, since the plugin doesn't use the multi line flag.

See regex101:

![grafik](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/5/6/56c5794758bd6e3a155f2ca68d00dbcdad9dbe11.png)

> global flag only (`/ +$/g`)

![grafik](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/6/d/6d739cb87c36d3b66f00f46f3cc6b033cc45c402.png)

> global and multi line flag (`/ +$/gm`)

I'll add a checkbox to enable the multi line flag.

---

<div class="post-metadata">

**Author:** ![jovandeginste](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jovandeginste/32/3268_2.png) [@jovandeginste](https://discourse.joplinapp.org/u/jovandeginste)\
**Post date:** [13 February 2023 10:00 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/16 "2023-02-13T10:00:15Z")

</div>

Makes sense, thanks!

---

<div class="post-metadata">

**Author:** ![FelisDiligens](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/felisdiligens/32/15953_2.png) [@FelisDiligens](https://discourse.joplinapp.org/u/FelisDiligens)\
**Post date:** [13 February 2023 10:19 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/17 "2023-02-13T10:19:34Z")

</div>

Added the checkbox, the update should be available within 15 mins. 👍

---

<div class="post-metadata">

**Author:** ![jovandeginste](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jovandeginste/32/3268_2.png) [@jovandeginste](https://discourse.joplinapp.org/u/jovandeginste)\
**Post date:** [13 February 2023 12:05 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/18 "2023-02-13T12:05:31Z")

</div>

Updated, tested and approved; works like a charm now, thanks!!

---

<div class="post-metadata">

**Author:** ![inkdu](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/inkdu/32/16515_2.png) [@inkdu](https://discourse.joplinapp.org/u/inkdu)\
**Post date:** [15 March 2023 16:43 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/19 "2023-03-15T16:43:46Z")

</div>

Nice plugin, thank you.  
Question: do you plan to add searching in several notes/a whole notebook?

---

<div class="post-metadata">

**Author:** ![netweaver1970](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/netweaver1970/32/17721_2.png) [@netweaver1970](https://discourse.joplinapp.org/u/netweaver1970)\
**Post date:** [30 August 2023 13:05 UTC](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242/20 "2023-08-30T13:05:23Z")

</div>

@FelisDiligens thanks for the plug-in, it's working very nice!

I second the previous request/question, I have converted notebooks (based of a CherryTree DB), using a python script ([GitHub - d4vydm/CherryTree2Joplin](https://github.com/d4vydm/CherryTree2Joplin)) but there are quite some HTML-to-MD translation errors, and I would like to clean-up certain tags across notes, eg. on a (sub) notebook level downwards. That would ease a lot of the manual clean-up.

Cheers

[Next page](https://discourse.joplinapp.org/t/plugin-search-and-replace/29242.md?page=2)
