Globally replace apples into bananas?

Is there a decent method to - without external tools - rename all occurences of some arbitrary string in all text fields, say, apple, into banana via a button click?

apple is not necessarily a tiddler title, but it could be. And the occurences will only appear in the text fields of non-system tiddlers.

Actual use case
I’m reeducating myself to get a formal degree as a teacher. Lots of note taking. But the notes often contain either outright the wrong word for some concept or they are in a form (e.g plural) that is not appropriate to turn into a tiddler.

…thus I have sometimes typed a [[missing to-be-tid but mispellled it]]. I want to be able to click these so the usual missing tiddler is shown but therein is where I want to be able to globally replace the string. I figure I’d need a ViewTemplate showing some text field and a button to do the magic encantation.

Further, I have the fantastic Freelinks plugin installed to detect words that match tiddler titles, automatically turning them into links. But it is easy to type, say, The Origin of Species when the tiddler really is titled On the Origin of Species and so there is no detection. Or vice versa, if I change the title of a tiddler, then previously auto-detected words are no longer freelink’ified. So I need a way to globally change those words. This is a bit risky but in my use case it’d be for non-system tids and the strings are often complex.

…so is there a magic formula to change apples into bananas, o’ thou master TWizads?

Thank you!

Yes. Tiddler Commander — SnR … by @Mohammad

Apart from simple global S&R it supports well Regular Expressions in native Javascript format

TT

3 Likes

Aaah, great! While that whole plugin is of course way more than I’m asking for, I should be able to understand the critical bits. Thanks!

these

.github.com/kookma/TW-Commander/blob/master/source/commander/snr/macros/regexpsub.js
ones
.kookma.github.io/TW-Commander/#%24%3A%2Fplugins%2Fkookma%2Fcommander%2Fsnr%2Fmacros%2Fregexpsub.js

?
:d

1 Like

I have a search and replace plugin from somewhere… In my wiki here https://steachertests.tiddlyhost.com

Couldn’t tell you of it works. I was surprised to see it when looking through the plugins list the other day.

1 Like

afaik its al just warping js regexp

1 Like

Right, thanks. Via some minor hacking, I did find the stuff in the demo wiki in spite of @Mohammad s hiding of the edit button there (why? I’m allowed to, right? :pray:)