Regex functionality for find and replace within obsidian

+1 Maintaining the simplicity spirit of markdown, the potential interface in Obsidian for regex support doesn’t need to be prominent. Those who know regex are likely to “know” obsidian on a deeper level. It may be likely they will try regex queries in the search menu or find. Making this a “hidden” feature that just works in either of these places may be a win-win, while maintaining an un-bloated, clean interface.

2 Likes

This is not possible I fear. E.g. if an unaware user would search for e.g. they will find ergo and other things and wonder why this happens. That’s why in most search features searching for regexes must be explicitly activated/selected.

It looks like VIM is the way to do this… still researching what it is and how to use it!

+1
this is a very important thing. very userfull for almost all users.
waiting for update.

1 Like

I must admit I forgot that VIM mode is an option and isn’t just there for everyone! And of course it takes a little while to get your head around the modal nature of vim, but once you have it and have learn’t how to use it well it is a very efficient way to work.

1 Like

You can make this argument about any feature request. At that point, why even bother with new software after vim was created?

+1 regex in search and replace is crucial

6 Likes

While you’re not wrong, there’s definitely a case to be made for wise allocation of resources. On an infinite timescale, of course this is a feature that should be added. But is it something they should add today or tomorrow if folks can put in a little effort to figure out an alternative solution? Maybe.

I believe @Cito was merely (and wisely) pointing out that if this is a thing you need to do today, it’s already possible with a little legwork.

+1 for this feature. I have to supposedly move my vault into vs code to do find and replace on multiple files. I hope this get implemented inside obsidian soon.

I am having the same problem with pandoc. Is there any script that do that by any chance? it would be easy to place all the files in a folder and edit them in bulk using a loop

If the files are Word document, you can use this: Simple PowerShell (for now) script to convert Microsoft Word files into markdown with pandoc - #5 by mafsi

If you are on Windows and use notepad++ 32bit there is a plugin called TextFX that can unwrap you text, but you have to manually process all the files one by one

+1 this would be very useful

I’ll add my support for this, mostly due to the fact that mobile doesn’t support Vi mode and hence has no way to do this.

4 Likes

I’m starving without this feature, please, implement it! For now I have to open my notes in Sublime or VS Code, and I use regex search and replace every day, so this is not very convenient.

1 Like

+1. It would make so many things easier!
I use atom now, but would be great not having to mess with my vault files with another editor (even if I can).

1 Like

+1 Very userful

I just released the first version of a plugin which adds this ability here: GitHub - nothingislost/obsidian-regex-search-replace: Plugin to enhance the functionality of Obsid

It’s not in the plugin repository yet so it needs to be installed manually for now. If anyone wants to test it out and provide feedback via Github issues, feel free.

Note: it does not support replacing text using regex capture groups yet but I will see if I can add support for that.

4 Likes

The latest release adds support for replacements using capture groups.

9 Likes

Hi the plugin no longer works. Do intend to support this plug in in the future?

1 Like

+1 - Would be super useful

1 Like