Here's a javascript macro you can play with in a safe place. It's just a 
think javascript macro wrapped around the underlying javascript system, so 
I'm sure it could be improved.

Invoke like:

<<regexpsub "(\w+)\s(\w+)" '$2, $1' "John Doe">>

Parameters *regtext* (which can be a regular expression, but also plain 
text if it's been escaped), *subtext* (the text to replace found text with. 
Note $1,$2... for replacing groups in regtext), and the *text* itself.

-- Mark

On Wednesday, February 13, 2019 at 10:34:08 PM UTC-8, Mohammad wrote:
>
> Yep,
>  That is really handy! Specially when you write codes
>
> Thanks Tnoy for the hint!
>
> Cheers
> Mohammad
>
> On Thursday, February 14, 2019 at 9:39:51 AM UTC+3:30, tony wrote:
>>
>> The command mode from the CodeMirror plugin with CodeMirror Keymap: vim 
>>
>> works quite lovely with
>>
>> :%s/foo/bar/gc
>>
>> Even more delicious is that yanks work across the tiddlers, ie yy to yank 
>> a line in one tiddler, open a different tiddler and p to paste
>>
>> Heck, even :sort to sort all lines in the tiddlers work
>>
>> Good stuff!
>>
>> Best,
>> tony
>>
>> On Wednesday, February 13, 2019 at 2:16:55 PM UTC-8, Mohammad wrote:
>>>
>>> Is there any way to search and replace in
>>> Tiddlers
>>>
>>>    - text
>>>    - field value
>>>
>>> for example search foo and replace with bar?
>>>
>>>
>>> --Mohammad
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fd36fc43-346c-40d6-a0e0-fe4fb0382e92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__MAS_macros_regexpsub.json
Description: application/json

Reply via email to