[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-07 Thread Diego Mesa
Hey Josiah

It was the last point you made that really clarified it for me - the 
difference engine visualization confused m. Thanks!

Diego


On Thursday, March 7, 2019 at 11:59:36 AM UTC-6, @TiddlyTweeter wrote:
>
> Diego,
>
> You are right. It does look odd. But it IS working fine. The reason why it 
> appears odd is ...
>
> -- you run in "multi-line" mode and that means the match string always 
> matches to first point that matches in the field. In this case the last two 
> letters of This".
>
> -- because your match ="is" and replace ="is not" no difference will show 
> for "is" as you don't change it.
>
> -- the "walking" green insertion is due to limits in the "difference" 
> engine that doesn't always know on repeated words quite where to display 
> the change. 
> It is actually happening directly next to "This".
>
> Hope this is clear!
> Josiah
>
> On Thursday, 7 March 2019 00:48:32 UTC+1, Diego Mesa wrote:
>>
>> Hey Mohammad,
>>
>> I have the following strange behavior:
>>
>> https://media.giphy.com/media/dgarQbGE4SycN4wGJF/giphy.gif
>>
>> On Wednesday, March 6, 2019 at 3:49:32 PM UTC-6, Mohammad wrote:
>>>
>>> *Update: Mar 7th, 2019*
>>>
>>> Changes:
>>>
>>>- new interface
>>>- regexp flags can be selected among *i, g,m* but not *g and m* at 
>>>the same time.
>>>- minor issues fixed
>>>
>>> Demo:
>>> http://kookma.tiddlyspot.com/(temporarily site )
>>>
>>> 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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/4f74e176-ef28-4983-aa36-f68e898d366f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-07 Thread @TiddlyTweeter
Diego,

You are right. It does look odd. But it IS working fine. The reason why it 
appears odd is ...

-- you run in "multi-line" mode and that means the match string always 
matches to first point that matches in the field. In this case the last two 
letters of This".

-- because your match ="is" and replace ="is not" no difference will show 
for "is" as you don't change it.

-- the "walking" green insertion is due to limits in the "difference" 
engine that doesn't always know on repeated words quite where to display 
the change. 
It is actually happening directly next to "This".

Hope this is clear!
Josiah

On Thursday, 7 March 2019 00:48:32 UTC+1, Diego Mesa wrote:
>
> Hey Mohammad,
>
> I have the following strange behavior:
>
> https://media.giphy.com/media/dgarQbGE4SycN4wGJF/giphy.gif
>
> On Wednesday, March 6, 2019 at 3:49:32 PM UTC-6, Mohammad wrote:
>>
>> *Update: Mar 7th, 2019*
>>
>> Changes:
>>
>>- new interface
>>- regexp flags can be selected among *i, g,m* but not *g and m* at 
>>the same time.
>>- minor issues fixed
>>
>> Demo:
>> http://kookma.tiddlyspot.com/(temporarily site )
>>
>> 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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/672057d8-8278-4495-9f11-5daf2b293478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-07 Thread Mohammad
SNR is released as a plugin.

This thread is closed here and a new thread is started to discuss the SNR 
plugin.
To follow the discussion from new thread have a look at

https://groups.google.com/d/msg/tiddlywiki/mkx1hZVH-I4/IeyC_GccBAAJ


I appreciate your feedback


--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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/e6853eca-3af6-44eb-b636-d00e543b9a10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Hello Diegi!
 I think the SNR does the job correctly!

May be Josiah can explain this in detail, but replace keep the parts in 
replaceValue and only add those characters word is not
available in the search value!

Here it actually change

This ---> This not
This > This not  }> This not not


--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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/29c37389-3565-4c09-9316-038f83f42134%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Diego Mesa
Hey Mohammad,

I have the following strange behavior:

https://media.giphy.com/media/dgarQbGE4SycN4wGJF/giphy.gif

On Wednesday, March 6, 2019 at 3:49:32 PM UTC-6, Mohammad wrote:
>
> *Update: Mar 7th, 2019*
>
> Changes:
>
>- new interface
>- regexp flags can be selected among *i, g,m* but not *g and m* at the 
>same time.
>- minor issues fixed
>
> Demo:
> http://kookma.tiddlyspot.com/(temporarily site )
>
> 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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/98de1b06-b6b7-4782-9624-f38c21035b2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
*Update: Mar 7th, 2019*

Changes:

   - new interface
   - regexp flags can be selected among *i, g,m* but not *g and m* at the 
   same time.
   - minor issues fixed

Demo:
http://kookma.tiddlyspot.com/(temporarily site )

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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b2dc9afb-58c5-4084-87b3-691bc99148bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Okay, Josiah!
I correct it!

--Mohammad

On Wednesday, March 6, 2019 at 7:59:11 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad,
>
> Excellent!
>
> An issue. You should not have Multi-line AND Global BOTH enabled! 
>
> They are mutually exclusive.
>
>
> [image: {B8C55E38-08DD-4CC0-8A36-68B8ADA7732A}.png.jpg]
>
>
> Best wishes
> Josiah
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/8573109c-d51f-4ffe-9f34-2afb6a40744a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Many thanks Jeremy!

It seems I should read and process the replaceValue first and then pass it 
to SNR macro!

By the way, I think this way I can handle control characters.

Best wishes
Mohammad


On Wednesday, March 6, 2019 at 8:26:31 PM UTC+3:30, Jeremy Ruston wrote:
>
> Hi Mohammad
>
> Sorry I missed your question in the thread. If you're trying to get a 
> control character into a string for use in a regexp, you can use a 
> construction like this:
>
> <$codeblock code={{{ [[%0a]decodeuricomponent[]addprefix[a]addsuffix[b]] 
> }}}/>
>
> The idea is to express the character in the % notation used by URIs, and 
> then use the decodeuricomponent filter operator to convert it into the 
> corresponding character. In this case, $0a corresponds to the newline 
> character (ascii code 10).
>
> Best wishes
>
> Jeremy.
>
> --
> Jeremy Ruston
> jer...@jermolene.com 
> https://jermolene.com
>
> On 6 Mar 2019, at 13:52, Mohammad > 
> wrote:
>
> Many Thanks Josiah!
>
> I would appreciate your time teaching us how to use regexp in Tiddlywiki 
> and specially here with SNR2.
> For the issue you mentioned, I could not find any solution and Jeremy 
> comments did not help me to understand what I should do!
>
> By the way, I thought it is better to choose the flag from interface, so I 
> am adding
>
> i: ignore case
> g: find all (global match)
> \b: whole words
> m: multi line mode
>
> So, user can select one or a mixed of them (of course \b is something 
> separate here!)
>
> I am not sure if m is useful here, but i and g are used frequently!
>
> --Mohammad
>
>
>
> On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>>
>> Mohammad & all interested
>>
>> I have done a lot of testing of "s-n-r2". It is very good!
>>
>>
>> *DIFFERENCES FROM NORMAL REGEX*
>>
>> It differs from normal regular expressions in that TiddlyWiki needs to 
>> guard itself from eating itself. 
>>
>>  
>>
>> *It does this by needing the regex to be wrapped in Quote Marks*.
>>
>> The type of quote marks differ according to the use-case.
>>
>> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
>> vice-versa.
>>
>>
>> IF a tiddler contains both * ' *  and * " * quotes then the match string 
>> is easiest enabled by wrapping it: * """regex""" *.
>>
>>
>>
>> *LIMITS*
>>
>> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
>> the string * """ *. Those 3 double quotes are likely protecting TW from 
>> itself but the regex can't currently cope with them. 
>>
>>  
>>
>> *That rules out safe s-n-r via regex in many macros.*
>>
>>  
>>
>> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
>> easy way to get Control Codes into output replaces. This is problematic as, 
>> for instance, we need to replace *  * with * \n```\n *. BUT in 
>> replace the "\n" is only treated as a literal.
>>
>>
>> Best wishes
>> Josiah
>>
>> -- 
> 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 tiddlywiki+...@googlegroups.com .
> To post to this group, send email to tiddl...@googlegroups.com 
> .
> 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/4aacaf40-2a40-43f2-a5ce-37a0ad33a1dc%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/639a3308-4b9f-4ca8-bb3c-2f35166239b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Jeremy Ruston
Hi Mohammad

Sorry I missed your question in the thread. If you're trying to get a control 
character into a string for use in a regexp, you can use a construction like 
this:

<$codeblock code={{{ [[%0a]decodeuricomponent[]addprefix[a]addsuffix[b]] }}}/>

The idea is to express the character in the % notation used by URIs, and then 
use the decodeuricomponent filter operator to convert it into the corresponding 
character. In this case, $0a corresponds to the newline character (ascii code 
10).

Best wishes

Jeremy.

--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 6 Mar 2019, at 13:52, Mohammad  wrote:
> 
> Many Thanks Josiah!
> 
> I would appreciate your time teaching us how to use regexp in Tiddlywiki and 
> specially here with SNR2.
> For the issue you mentioned, I could not find any solution and Jeremy 
> comments did not help me to understand what I should do!
> 
> By the way, I thought it is better to choose the flag from interface, so I am 
> adding
> 
> i: ignore case
> g: find all (global match)
> \b: whole words
> m: multi line mode
> 
> So, user can select one or a mixed of them (of course \b is something 
> separate here!)
> 
> I am not sure if m is useful here, but i and g are used frequently!
> 
> --Mohammad
> 
> 
> 
>> On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>> Mohammad & all interested
>> 
>> I have done a lot of testing of "s-n-r2". It is very good!
>> 
>> 
>> DIFFERENCES FROM NORMAL REGEX
>> 
>> It differs from normal regular expressions in that TiddlyWiki needs to guard 
>> itself from eating itself.
>>  
>> It does this by needing the regex to be wrapped in Quote Marks.
>> 
>> The type of quote marks differ according to the use-case.
>> 
>> IF a tiddler only contains  '  then wrapping in  "  will work. And 
>> vice-versa.
>> 
>> IF a tiddler contains both  '   and  "  quotes then the match string is 
>> easiest enabled by wrapping it:  """regex""" .
>> 
>> 
>> LIMITS
>> 
>> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
>> the string  """ . Those 3 double quotes are likely protecting TW from itself 
>> but the regex can't currently cope with them.
>>  
>> That rules out safe s-n-r via regex in many macros.
>>  
>> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no easy 
>> way to get Control Codes into output replaces. This is problematic as, for 
>> instance, we need to replacewith  \n```\n . BUT in replace the "\n" 
>> is only treated as a literal.
>> 
>> Best wishes
>> Josiah
>> 
> 
> -- 
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> 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/4aacaf40-2a40-43f2-a5ce-37a0ad33a1dc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/749A1EF7-3D32-4989-A38A-E6C8C1412C0E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread @TiddlyTweeter
 Mohammad asked:

> ... please let me know, if snr has any conflict with regexp or pass TW ...
>

There are NO unique problems in SNR. Relax :-).

TW issues we know already are not SNR  issues per se. They are broader ...

1 -- Tiddlers containing strings * """ * can't be safely matched,


2 -- Getting *Control Strings i*nto Replace is an ongoing issue.


Best wishes
Josiah
 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/fbe38a16-14b2-4452-9fea-2a9ccbab70fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread @TiddlyTweeter
Mohammad,

Excellent!

An issue. You should not have Multi-line AND Global BOTH enabled! 

They are mutually exclusive.


[image: {B8C55E38-08DD-4CC0-8A36-68B8ADA7732A}.png.jpg]


Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/89e8cb7f-e343-4907-b1c0-b48945405d66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
*Announcement: SNR2*

*Update: Mar 6th, 2019*

Changes:

   - regexp flags added (g, m, i)
   - whole words search added
   - minor issues fixed


This tool has amazing feature: You can search no only the text filed but 
also tags, caption, creator, ... and any other fields
You can even search and replace in tiddler title (in this case a new 
tiddler will be created!)

*Please send you feedback and comments here!*


--

*Announcement: SNR2*

This is a simple script, search-n-replcae (*snr2*) to search in tiddler 
contents (including all fields) for a searchValue and replace them with 
replaceValue.

Demo:
http://kookma.tiddlyspot.com/(temporarily site )

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/8a0006b6-f861-4379-bb75-601192b6e9f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Okay!
 I am achanging the interface and will upload a new update within an hour.

--Mohammad

On Wednesday, March 6, 2019 at 5:29:59 PM UTC+3:30, @TiddlyTweeter wrote:
>
> M,
>
> In particular, *multi-line mode* is excellent! Great news!
>
> It allows step by step changes.
>
> J.
>
> On Wednesday, 6 March 2019 14:52:51 UTC+1, Mohammad wrote:
>>
>> Many Thanks Josiah!
>>
>> I would appreciate your time teaching us how to use regexp in Tiddlywiki 
>> and specially here with SNR2.
>> For the issue you mentioned, I could not find any solution and Jeremy 
>> comments did not help me to understand what I should do!
>>
>> By the way, I thought it is better to choose the flag from interface, so 
>> I am adding
>>
>> i: ignore case
>> g: find all (global match)
>> \b: whole words
>> m: multi line mode
>>
>> So, user can select one or a mixed of them (of course \b is something 
>> separate here!)
>>
>> I am not sure if m is useful here, but i and g are used frequently!
>>
>> --Mohammad
>>
>>
>>
>> On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>>>
>>> Mohammad & all interested
>>>
>>> I have done a lot of testing of "s-n-r2". It is very good!
>>>
>>>
>>> *DIFFERENCES FROM NORMAL REGEX*
>>>
>>> It differs from normal regular expressions in that TiddlyWiki needs to 
>>> guard itself from eating itself. 
>>>
>>>  
>>>
>>> *It does this by needing the regex to be wrapped in Quote Marks*.
>>>
>>> The type of quote marks differ according to the use-case.
>>>
>>> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
>>> vice-versa.
>>>
>>>
>>> IF a tiddler contains both * ' *  and * " * quotes then the match 
>>> string is easiest enabled by wrapping it: * """regex""" *.
>>>
>>>
>>>
>>> *LIMITS*
>>>
>>> 1 - I have found NO WAY to safely make changes in a tiddler that 
>>> contains the string * """ *. Those 3 double quotes are likely 
>>> protecting TW from itself but the regex can't currently cope with them. 
>>>
>>>  
>>>
>>> *That rules out safe s-n-r via regex in many macros.*
>>>
>>>  
>>>
>>> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
>>> easy way to get Control Codes into output replaces. This is problematic as, 
>>> for instance, we need to replace *  * with * \n```\n *. BUT in 
>>> replace the "\n" is only treated as a literal.
>>>
>>>
>>> Best wishes
>>> Josiah
>>>
>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/988a8b64-5e14-4caa-b4f1-b60e689eb374%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread @TiddlyTweeter
M,

In particular, *multi-line mode* is excellent! Great news!

It allows step by step changes.

J.

On Wednesday, 6 March 2019 14:52:51 UTC+1, Mohammad wrote:
>
> Many Thanks Josiah!
>
> I would appreciate your time teaching us how to use regexp in Tiddlywiki 
> and specially here with SNR2.
> For the issue you mentioned, I could not find any solution and Jeremy 
> comments did not help me to understand what I should do!
>
> By the way, I thought it is better to choose the flag from interface, so I 
> am adding
>
> i: ignore case
> g: find all (global match)
> \b: whole words
> m: multi line mode
>
> So, user can select one or a mixed of them (of course \b is something 
> separate here!)
>
> I am not sure if m is useful here, but i and g are used frequently!
>
> --Mohammad
>
>
>
> On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>>
>> Mohammad & all interested
>>
>> I have done a lot of testing of "s-n-r2". It is very good!
>>
>>
>> *DIFFERENCES FROM NORMAL REGEX*
>>
>> It differs from normal regular expressions in that TiddlyWiki needs to 
>> guard itself from eating itself. 
>>
>>  
>>
>> *It does this by needing the regex to be wrapped in Quote Marks*.
>>
>> The type of quote marks differ according to the use-case.
>>
>> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
>> vice-versa.
>>
>>
>> IF a tiddler contains both * ' *  and * " * quotes then the match string 
>> is easiest enabled by wrapping it: * """regex""" *.
>>
>>
>>
>> *LIMITS*
>>
>> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
>> the string * """ *. Those 3 double quotes are likely protecting TW from 
>> itself but the regex can't currently cope with them. 
>>
>>  
>>
>> *That rules out safe s-n-r via regex in many macros.*
>>
>>  
>>
>> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
>> easy way to get Control Codes into output replaces. This is problematic as, 
>> for instance, we need to replace *  * with * \n```\n *. BUT in 
>> replace the "\n" is only treated as a literal.
>>
>>
>> Best wishes
>> Josiah
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b064f9d0-34ef-4938-b647-3e7a513c9acf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
One more comment:

I am not good at regexp, but I think snr should follow what is 
reule/standard in Tiddlywiki, so
I think we need to change the code to act as the current regexp operator 
(https://tiddlywiki.com/#regexp%20Operator)

So, please let me know, if snr has any conflict with regexp or pass TW red 
lines!

--Mohammad

On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad & all interested
>
> I have done a lot of testing of "s-n-r2". It is very good!
>
>
> *DIFFERENCES FROM NORMAL REGEX*
>
> It differs from normal regular expressions in that TiddlyWiki needs to 
> guard itself from eating itself. 
>
>  
>
> *It does this by needing the regex to be wrapped in Quote Marks*.
>
> The type of quote marks differ according to the use-case.
>
> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
> vice-versa.
>
>
> IF a tiddler contains both * ' *  and * " * quotes then the match string 
> is easiest enabled by wrapping it: * """regex""" *.
>
>
>
> *LIMITS*
>
> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
> the string * """ *. Those 3 double quotes are likely protecting TW from 
> itself but the regex can't currently cope with them. 
>
>  
>
> *That rules out safe s-n-r via regex in many macros.*
>
>  
>
> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
> easy way to get Control Codes into output replaces. This is problematic as, 
> for instance, we need to replace *  * with * \n```\n *. BUT in 
> replace the "\n" is only treated as a literal.
>
>
> Best wishes
> Josiah
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/585dc0d4-16a7-4b42-ae88-80e949b54549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Josiah!
 I appreciate if you put these comments in few tiddlers to added as help to 
SNR2.

--Mohammad

On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad & all interested
>
> I have done a lot of testing of "s-n-r2". It is very good!
>
>
> *DIFFERENCES FROM NORMAL REGEX*
>
> It differs from normal regular expressions in that TiddlyWiki needs to 
> guard itself from eating itself. 
>
>  
>
> *It does this by needing the regex to be wrapped in Quote Marks*.
>
> The type of quote marks differ according to the use-case.
>
> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
> vice-versa.
>
>
> IF a tiddler contains both * ' *  and * " * quotes then the match string 
> is easiest enabled by wrapping it: * """regex""" *.
>
>
>
> *LIMITS*
>
> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
> the string * """ *. Those 3 double quotes are likely protecting TW from 
> itself but the regex can't currently cope with them. 
>
>  
>
> *That rules out safe s-n-r via regex in many macros.*
>
>  
>
> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
> easy way to get Control Codes into output replaces. This is problematic as, 
> for instance, we need to replace *  * with * \n```\n *. BUT in 
> replace the "\n" is only treated as a literal.
>
>
> Best wishes
> Josiah
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/3430080d-4b2e-47d4-ae33-b33d69a08e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread Mohammad
Many Thanks Josiah!

I would appreciate your time teaching us how to use regexp in Tiddlywiki 
and specially here with SNR2.
For the issue you mentioned, I could not find any solution and Jeremy 
comments did not help me to understand what I should do!

By the way, I thought it is better to choose the flag from interface, so I 
am adding

i: ignore case
g: find all (global match)
\b: whole words
m: multi line mode

So, user can select one or a mixed of them (of course \b is something 
separate here!)

I am not sure if m is useful here, but i and g are used frequently!

--Mohammad



On Wednesday, March 6, 2019 at 5:10:19 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad & all interested
>
> I have done a lot of testing of "s-n-r2". It is very good!
>
>
> *DIFFERENCES FROM NORMAL REGEX*
>
> It differs from normal regular expressions in that TiddlyWiki needs to 
> guard itself from eating itself. 
>
>  
>
> *It does this by needing the regex to be wrapped in Quote Marks*.
>
> The type of quote marks differ according to the use-case.
>
> IF a tiddler only contains * ' * then wrapping in * " * will work. And 
> vice-versa.
>
>
> IF a tiddler contains both * ' *  and * " * quotes then the match string 
> is easiest enabled by wrapping it: * """regex""" *.
>
>
>
> *LIMITS*
>
> 1 - I have found NO WAY to safely make changes in a tiddler that contains 
> the string * """ *. Those 3 double quotes are likely protecting TW from 
> itself but the regex can't currently cope with them. 
>
>  
>
> *That rules out safe s-n-r via regex in many macros.*
>
>  
>
> 2 -  SUBSTITUTION. Mohammad and I found out that there is currently no 
> easy way to get Control Codes into output replaces. This is problematic as, 
> for instance, we need to replace *  * with * \n```\n *. BUT in 
> replace the "\n" is only treated as a literal.
>
>
> Best wishes
> Josiah
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/4aacaf40-2a40-43f2-a5ce-37a0ad33a1dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-06 Thread @TiddlyTweeter
Mohammad & all interested

I have done a lot of testing of "s-n-r2". It is very good!


*DIFFERENCES FROM NORMAL REGEX*

It differs from normal regular expressions in that TiddlyWiki needs to 
guard itself from eating itself. 

 

*It does this by needing the regex to be wrapped in Quote Marks*.

The type of quote marks differ according to the use-case.

IF a tiddler only contains * ' * then wrapping in * " * will work. And 
vice-versa.


IF a tiddler contains both * ' *  and * " * quotes then the match string is 
easiest enabled by wrapping it: * """regex""" *.



*LIMITS*

1 - I have found NO WAY to safely make changes in a tiddler that contains 
the string * """ *. Those 3 double quotes are likely protecting TW from 
itself but the regex can't currently cope with them. 

 

*That rules out safe s-n-r via regex in many macros.*

 

2 -  SUBSTITUTION. Mohammad and I found out that there is currently no easy 
way to get Control Codes into output replaces. This is problematic as, for 
instance, we need to replace *  * with * \n```\n *. BUT in replace the 
"\n" is only treated as a literal.


Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/7806ffb5-0cd2-4c33-bc23-88dffc5482f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-05 Thread @TiddlyTweeter
I'm not sure how much TiddlyWiki users understand regular expressions.

There are TWO basic modes. 

When flag  m  ("multi-line") is enabled matching is for only the FIRST 
match to the regular expression. 

When flag  g   ("global") is enabled the match is repeated until no further 
matches are possible.

The flags also change the SCOPE. 

Under  m  the start anchor at the beginning of a LINE is  ^  and terminates 
at line end with  $ .

Under  g  the start anchor is at start of  the FIELD with  ^  and 
terminates at the end of the field  $ .

These two screenshots show the difference ...

UNDER "G" ...

[image: {0F0F80DE-081D-4D8A-8A57-3215C21CA595}.png.jpg]


UNDER "M" ...

[image: {26B57C27-4C5F-404F-9119-3CAB602B66CC}.png.jpg]


Just info I thought useful.

Best wishes
Josiah 







-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/de36a590-3ce2-4553-9fc3-74148ffd4e74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-05 Thread @TiddlyTweeter
Ciao Mohammad

It works fine! Its different and useful. "m" mode allows STEPS on changes 
that "g" doesn't.

It is possible that your tool could support both  m  and  g ?

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/73e0e0d7-7ee0-4678-a46f-9ae3374fb730%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-05 Thread Mohammad
Yes, It is possible!
Save and reload and it should works.

--Mohammad

On Tuesday, March 5, 2019 at 11:15:31 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Ciao Mohammad
>
> I request that the  m  flag be enabled to be toggled ON.
>
> In some ways it might be better if  m  mode were  the DEFAULT as its far 
> less dangerous than  g  .
>
> FYI, I found it quite easy to get it run using "m" flag just by changing 
> the JS code from "g" to "m" ... like this ...
>
> [image: {A7EE5869-65BB-4ABE-9471-6E897410BED5}.png.jpg]
>
>
> Would this be possible?
>
> Best wishes
> Josiah 
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/fba52f82-859d-40c9-8b25-5c797c889219%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-05 Thread @TiddlyTweeter
Ciao Mohammad

I request that the  m  flag be enabled to be toggled ON.

In some ways it might be better if  m  mode were  the DEFAULT as its far 
less dangerous than  g  .

FYI, I found it quite easy to get it run using "m" flag just by changing 
the JS code from "g" to "m" ... like this ...

[image: {A7EE5869-65BB-4ABE-9471-6E897410BED5}.png.jpg]


Would this be possible?

Best wishes
Josiah 


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/451fcd96-3e1d-4a62-b509-d61c454f5c62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
Exactly right.

On Monday, 4 March 2019 22:29:16 UTC+1, Mohammad wrote:
>
> Yes, I got it. I am experimenting to see how resolve the issue.
> The same is true for tab character \t
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/e2467064-79bb-48b3-94a2-a0b597833230%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread Mohammad
Yes, I got it. I am experimenting to see how resolve the issue.
The same is true for tab character \t

--Mohammad

On Tuesday, March 5, 2019 at 12:48:57 AM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad
>
> The issue  is simply that we can get the MATCH well. But on REPLACE we 
> might need to INSERT additional things that MATCH can't do.
>
> Hope this is clear!
> Josiah
>
> On Monday, 4 March 2019 21:54:46 UTC+1, Mohammad wrote:
>>
>> Hi Josiah,
>>  Seems it is true, have a look at
>>
>> https://www.regular-expressions.info/replacenonprint.html
>>
>>
>> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b3c6a0c2-2e2f-47ea-b37b-3499f3de9553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
Mohammad

The issue  is simply that we can get the MATCH well. But on REPLACE we 
might need to INSERT additional things that MATCH did not find.

Hope this is clear!
Josiah

On Monday, 4 March 2019 21:54:46 UTC+1, Mohammad wrote:
>
> Hi Josiah,
>  Seems it is true, have a look at
>
> https://www.regular-expressions.info/replacenonprint.html
>
>
> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/c74ed591-d148-4d14-b674-ce5bba73eda3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
Great site. Jan Goyvearts  
is one of my favourite programmers. He is the KING of Regular Expressions.

On Monday, 4 March 2019 21:54:46 UTC+1, Mohammad wrote:
>
> Hi Josiah,
>  Seems it is true, have a look at
>
> https://www.regular-expressions.info/replacenonprint.html
>
>
> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/4e051cb8-18a6-445f-bdf2-9a7813b72840%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread Mohammad
Hi Josiah,
 Seems it is true, have a look at

https://www.regular-expressions.info/replacenonprint.html


--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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/0e27a8fd-ad36-4304-8a2e-aa11eb353261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
The issue in the case is the Replace, not the Match.

Its about ADDITIONAL INSERT of "\nl" that the JS won't natively provide

Hope this is clear!
Josiah


On Monday, 4 March 2019 21:18:50 UTC+1, Mohammad wrote:
>
> Hello Josiah,
>  Thank you for your comments!
> SNR2 simply use the JS replace function. So, everything is possible with 
> JS replace theoretically should be possible with SNR2.
>
> By the way I will investigate the case! 
>
> --Mohammad
>
> On Monday, March 4, 2019 at 11:06:10 PM UTC+3:30, @TiddlyTweeter wrote:
>>
>> This is a footnote. Just FYI.
>>
>> Regular Expressions are one of the few things I understand well. 
>>
>> So IF anything I write about them seems difficult to understand please 
>> ask for clarification.
>>
>> Best wishes
>> Josiah
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/f694c3da-d916-48ee-a0c5-f605ad584e11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread Mohammad
Hello Josiah,
 Thank you for your comments!
SNR2 simply use the JS replace function. So, everything is possible with JS 
replace theoretically should be possible with SNR2.

By the way I will investigate the case! 

--Mohammad

On Monday, March 4, 2019 at 11:06:10 PM UTC+3:30, @TiddlyTweeter wrote:
>
> This is a footnote. Just FYI.
>
> Regular Expressions are one of the few things I understand well. 
>
> So IF anything I write about them seems difficult to understand please ask 
> for clarification.
>
> Best wishes
> Josiah
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/436e18ad-161d-4fa8-9fae-b2d706b37697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
This is a footnote. Just FYI.

Regular Expressions are one of the few things I understand well. 

So IF anything I write about them seems difficult to understand please ask 
for clarification.

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/4b672203-7dd3-4d80-a2b8-7172cc4fe8cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
An issue ... Take this case ...

[image: {4FE0AE98-959D-41B0-AC8D-E1450D37143C}.png.jpg]


This replaces  tags with ```.

The issue is to also add newlines before and after the backticks. 
As far as I can see the only way to get newlines into the replace pattern 
is via using a Capturing Group. 
But this over complicates the regex and won't always work (if the searched 
string has no \n at its start or end).

So, I'm wondering if \n could be directly included in Replace patterns and 
force insert of newlines? This is a common need in TW, I think?

A thought
Josiah 


@TiddlyTweeter wrote:
>
> First, can both the Search & Replace boxes be made a lot WIDER? Some regex 
> get long!
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/47ff6126-1dfb-4f7d-9860-c309dc218945%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
Ciao Mohammad

I have a few requests and comments. I'll write them in separate posts.

First, can both the Search & Replace boxes be made a lot WIDER? Some regex 
get long!

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/791d852f-35b3-4f2b-b781-d0fff396b4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread Mohammad
Hi Josiah

Many thanks. I will upload a new update.
I fixed the issue. I appreciate your time for evaluating the code and welcome 
your write up.

Best
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/4f22cde2-5141-4620-b79f-0e454ca6d4c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-04 Thread @TiddlyTweeter
Ciao Mohammad
I studied it more. You CAN use it to match  > but you need the search entry 
to be wrapped in quote-marks.

Similarly if you want to find double quote marks " you need to wrap them in 
quote marks of a different type.

To make best use of this powerful tool I think it needs user instructions 
as its a bit different than normal regular expressions in how it works. 

I'll write up some notes over the next week.

Best wishes
Josiah


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/87b7f1cc-6651-4f1a-bbfc-a25405afc538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-03 Thread Mohammad
Many Thanks!
Yes, I checked and it seems `>` break the codes!
I will have look to see how I can fixed it.

Cheers
Mohammad

On Sunday, March 3, 2019 at 2:43:54 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Ciao Mohammad
>
> I'll do lots of testing of SNR2 on  http://kookma.tiddlyspot.com/  and 
> report back. It looks very good and very powerful!
>
> The is one BUG I found already. You can easily see it. Just enter ">" in 
> the search box and it breaks the script like this...
>
> [image: {4F3AC098-4005-4D1D-B466-3ECFDD1B3F90}.png.jpg]
>
> Best wishes
> Josiah
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/945a519d-631f-4820-b21c-051e8345b5ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-03 Thread @TiddlyTweeter
Ciao Mohammad

I'll do lots of testing of SNR2 on  http://kookma.tiddlyspot.com/  and 
report back. It looks very good and very powerful!

The is one BUG I found already. You can easily see it. Just enter ">" in 
the search box and it breaks the script like this...

[image: {4F3AC098-4005-4D1D-B466-3ECFDD1B3F90}.png.jpg]

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/fec8c035-748c-4a0f-8d66-79a0ec6a871a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-03-02 Thread Mohammad
*SNR2 announced.*

SNR2 uses a small JS macro and can do search and replace in tiddler fields.
It is a flexible tool can perform search-n-replace in case-sensitive, 
case-insensitive
wholewords, ... manner

It also accept sregular expression so from this point of view is really 
powerful.
It can search for carriage return using \n  (asked by other users) and much 
more ...


See original post
https://groups.google.com/d/msg/tiddlywiki/BwgwkxaXY_o/QtibP6v7BwAJ


SNR2 will be merged into Tiddler Commander.

Best regards
--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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/10dc2941-6447-4a99-8284-2838b43caa86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Hello Thomas,
 Many thanks for your feedback. The problem is with snr as it uses some 
filter operators not simply work with with regexp expression, if so
I personally prefer to have \t, \n, ... and like that in search area!

Cheers
Mohammad

On Friday, March 1, 2019 at 1:19:19 AM UTC+3:30, Thomas Elmiger wrote:
>
> Hi Mohammad, thank you, that looks very useful!
>
> Regarding carriage (really?) returns, Josiah and BTC,
>
> I would prefer a textarea that looks like an input field – but with the 
> option to expand when needed. Like so:
>
> <$edit-text tiddler="test" field="demo" tag="textarea" rows="1" 
> autoHeight="yes" minHeight="1.75em"/>
>
> Simple enough?
>
> All the best,
> Thomas
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/c41233a7-ad17-434a-ab55-6711bb631fd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread BurningTreeC

>
> Hi Mohammad, thank you, that looks very useful!
>
> Regarding carriage (really?) returns, Josiah and BTC,
>
> I would prefer a textarea that looks like an input field – but with the 
> option to expand when needed. Like so:
>
> <$edit-text tiddler="test" field="demo" tag="textarea" rows="1" 
> autoHeight="yes" minHeight="1.75em"/>
>

Oh yes, that's better. I found it's a problem not knowing if there are 
newlines in a seamingly empty textarea or not 

>
> Simple enough?
>
> All the best,
> Thomas
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/e4d50194-d380-4f2d-b004-265d403504ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Thomas Elmiger
Hi Mohammad, thank you, that looks very useful!

Regarding carriage (really?) returns, Josiah and BTC,

I would prefer a textarea that looks like an input field – but with the 
option to expand when needed. Like so:

<$edit-text tiddler="test" field="demo" tag="textarea" rows="1" 
autoHeight="yes" minHeight="1.75em"/>

Simple enough?

All the best,
Thomas

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b3f63417-9a5c-4f93-81b7-3d084b81eff2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread David Gifford
Oh, sorry, I came here because I thought you wrote "ASMR" plugin...

On Thursday, February 28, 2019 at 12:54:26 AM UTC-6, Mohammad wrote:
>
> Announcement: SNR
>
> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
> contents (including all fields) for a searchValue and replace them with 
> replaceValue.
>
> See the original post here!
>
> https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ
>
>
> Demo: https://kookma.github.io/search-n-replace/
>
>
> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/8ae960d8-6cdb-4ff3-a3f5-671dd1ca7899%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread BurningTreeC

>
> BTC
>
> That is good news!! 
>
> Rather than have a text area could it be done via substitution? 
>

No that's too complicated I'm not even going to give the try a thought ;)

 

> I'm thinking of the complexity of the interface to have a text area just 
> for that. 
> For instance could, with the example I gave, this work through the simple 
> input fields ?...
>
> Search ...
> \r\r
>
> Replace ...
> \r```\r
>
> Just thinking out loud
> Best wishes
> Josiah
>
> On Thursday, 28 February 2019 19:42:40 UTC+1, BurningTreeC wrote:
>>
>> This is such a good tool Mohammad! 
>>>
>>> I ask a final, probably, very difficult, question ...
>>>
>>> Can we match CARRIAGE RETURNS? And can we INSERT them in replacement 
>>> strings?
>>>
>>
>> Hi Josiah, an sorry Mohammad, it can handle carriage returns, too.
>>
>> Just make the inputs where you write the text to replace and the new text 
>> with textareas ... give those edit-text widgets the tag="textarea" 
>> attribute ... then play around with new lines
>>  
>>
>>>
>>> Here is a simple example ...
>>>
>>>
>>>
>>> The man was on the burning deck
>>> His light was dim
>>> And he got bogged.
>>>
>>>
>>>
>>>
>>> To do that you need to replace the HTML tags and remove excess carriage 
>>> returns and replace with WikiText and insert carriage returns to get...
>>>
>>> ```
>>> The man was on the burning deck
>>> His light was dim
>>> And he got bogged.
>>> ```
>>>
>>> Could this be possible?
>>>
>>> Just wondering
>>> Best wishes
>>> Josiah
>>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/ecd8c4fb-b198-46bc-92e9-76314d2f960e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
BTC

That is good news!! 

Rather than have a text area could it be done via substitution? 
I'm thinking of the complexity of the interface to have a text area just 
for that. 
For instance could, with the example I gave, this work through the simple 
input fields ?...

Search ...
\r\r

Replace ...
\r```\r

Just thinking out loud
Best wishes
Josiah

On Thursday, 28 February 2019 19:42:40 UTC+1, BurningTreeC wrote:
>
> This is such a good tool Mohammad! 
>>
>> I ask a final, probably, very difficult, question ...
>>
>> Can we match CARRIAGE RETURNS? And can we INSERT them in replacement 
>> strings?
>>
>
> Hi Josiah, an sorry Mohammad, it can handle carriage returns, too.
>
> Just make the inputs where you write the text to replace and the new text 
> with textareas ... give those edit-text widgets the tag="textarea" 
> attribute ... then play around with new lines
>  
>
>>
>> Here is a simple example ...
>>
>>
>>
>> The man was on the burning deck
>> His light was dim
>> And he got bogged.
>>
>>
>>
>>
>> To do that you need to replace the HTML tags and remove excess carriage 
>> returns and replace with WikiText and insert carriage returns to get...
>>
>> ```
>> The man was on the burning deck
>> His light was dim
>> And he got bogged.
>> ```
>>
>> Could this be possible?
>>
>> Just wondering
>> Best wishes
>> Josiah
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/ed053737-ee00-4942-bc39-146f63e5b47b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread BurningTreeC

>
> This is such a good tool Mohammad! 
>
> I ask a final, probably, very difficult, question ...
>
> Can we match CARRIAGE RETURNS? And can we INSERT them in replacement 
> strings?
>

Hi Josiah, an sorry Mohammad, it can handle carriage returns, too.

Just make the inputs where you write the text to replace and the new text 
with textareas ... give those edit-text widgets the tag="textarea" 
attribute ... then play around with new lines
 

>
> Here is a simple example ...
>
>
>
> The man was on the burning deck
> His light was dim
> And he got bogged.
>
>
>
>
> To do that you need to replace the HTML tags and remove excess carriage 
> returns and replace with WikiText and insert carriage returns to get...
>
> ```
> The man was on the burning deck
> His light was dim
> And he got bogged.
> ```
>
> Could this be possible?
>
> Just wondering
> Best wishes
> Josiah
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/2bacbb6d-a742-4884-b33b-b651700ec412%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Josiah,
 With current situation, my answer is unfortunately NO!
But the other macro I have developed can find and do *partial transclusion*

https://kookma.github.io/find-macro/


So, a mix of these two can do the job, but needs extra programming to work 
together.

--Mohammad


On Thursday, February 28, 2019 at 9:00:25 PM UTC+3:30, @TiddlyTweeter wrote:
>
> This is such a good tool Mohammad! 
>
> I ask a final, probably, very difficult, question ...
>
> Can we match CARRIAGE RETURNS? And can we INSERT them in replacement 
> strings?
>
> Here is a simple example ...
>
>
>
> The man was on the burning deck
> His light was dim
> And he got bogged.
>
>
>
>
> To do that you need to replace the HTML tags and remove excess carriage 
> returns and replace with WikiText and insert carriage returns to get...
>
> ```
> The man was on the burning deck
> His light was dim
> And he got bogged.
> ```
>
> Could this be possible?
>
> Just wondering
> Best wishes
> Josiah
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/191a0b06-b982-4f98-9003-cd12d66b5d65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
This is such a good tool Mohammad! 

I ask a final, probably, a very difficult, question ...

Can we match CARRIAGE RETURNS? And can we INSERT them in replacement 
strings?

Here is a simple example ...



The man was on the burning deck
His light was dim
And he got bogged.




To do that you need to replace the HTML tags and remove excess carriage 
returns and replace with WikiText and insert carriage returns to get...

```
The man was on the burning deck
His light was dim
And he got bogged.
```

Could this be possible?

Just wondering
Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/10bde5c8-2d35-435c-9346-ae7624c2bc74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Josiah,
 Have a look ate TW roadmap:

https://tiddlywiki.com/static/RoadMap.html

It gives hope for the feature we like!

--Mohammad

On Thursday, February 28, 2019 at 7:24:17 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Diego Mesa wrote:
>>
>> In my mind, an "undo function" is synonymous with "version control". 
>>
>
> I agree. Kinda. Though likely more short term than normal VC.
>
> Mohammad wrote:
>
>> But I am afraid duplication tiddlers in this way will result in huge file 
>>> size.
>>>
>>
> I agree it would *if it were persistent*. I'm thinking more of cloning of 
> just a "start version" that persists only as long as you doing the replace. 
> That when you finish and happy ts deleted?
>
> Best wishes
> Josiah
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/605ab9c0-ec37-4f0b-aae4-e65d59f08be8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
Diego Mesa wrote:
>
> In my mind, an "undo function" is synonymous with "version control". 
>

I agree. Kinda. Though likely more short term than normal VC.

Mohammad wrote:

> But I am afraid duplication tiddlers in this way will result in huge file 
>> size.
>>
>
I agree it would *if it were persistent*. I'm thinking more of cloning of 
just a "start version" that persists only as long as you doing the replace. 
That when you finish and happy ts deleted?

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b7df602c-cac0-45a1-aba4-5bbaf79648c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Hi Diego,
 That's absolutely correct! and seems the safer solution.

--Mohammad

On Thursday, February 28, 2019 at 6:56:50 PM UTC+3:30, Diego Mesa wrote:
>
> In my mind, an "undo function" is synonymous with "version control". 
>
> On Thursday, February 28, 2019 at 9:19:10 AM UTC-6, Mohammad wrote:
>>
>> Yes, an undo function is possible to not overwrite the original tiddlers.
>> But I am afraid duplication tiddlers in this way will result in huge file 
>> size.
>>
>> --Mohammad
>>
>> On Thursday, February 28, 2019 at 6:19:57 PM UTC+3:30, @TiddlyTweeter 
>> wrote:
>>>
>>> Mohammad
>>>
>>> Really excellent. Its working well and I haven't been able to get it to 
>>> fail. It will have huge use I am sure.
>>>
>>> I do think an issue is UNDO.
>>>
>>> Let me show why ...
>>>
>>> On a balmy day SHE took advice that HE needed to walk.
>>>
>>> If we replace "SHE" with "HE" we get ...
>>>
>>> On a balmy day HE took advice that HE needed to walk.
>>>
>>> But it can't easily be reversed  just switching "find" & "replace" terms 
>>> as you'd get ...
>>>
>>> On a balmy day SHE took advice that SHE needed to walk.
>>>
>>>
>>> I think the simplest way to deal with this is that a Tiddler under s-n-r 
>>> is cloned to a state tiddler before changes occur that can be RESTORED.
>>>
>>> What do you think?
>>>
>>> Best wishes
>>> Josiah
>>>
>>>
>>>
>>> Could the tiddler/s you working on be 
>>>
>>> On Thursday, 28 February 2019 07:54:26 UTC+1, Mohammad wrote:

 Announcement: SNR

 This is a simple script, search-n-replcae (*snr*) to search in tiddler 
 contents (including all fields) for a searchValue and replace them with 
 replaceValue.

 See the original post here!

 https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ


 Demo: https://kookma.github.io/search-n-replace/


 --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/44194f21-8726-4f50-8642-48feacd21542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
Mohammad

The problem is, it will fail to distinguish punctuation. So, it can find 
> " test " but not " test!".


For my use cases that does does not matter at all!

It is "*exact string replace*" and it works very well.  I'm using it fine, 
often without any leading or trailing space. The *viability is context 
dependent*.

For instance the novel Great Expectations "Pip" is a unique character and a 
rare string in English so searches on "Pip" work also for ...

Pip  or Pip's or Pip. or Pip! etc

It works well ... for instance,

[image: {E0588A6F-5A0D-4743-8180-DA32001E32DD}.png.jpg]



Basically, with care, you can do most anything with it.

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/9594b4de-0cae-47bc-a27c-053dd0801919%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Diego Mesa
In my mind, an "undo function" is synonymous with "version control". 

On Thursday, February 28, 2019 at 9:19:10 AM UTC-6, Mohammad wrote:
>
> Yes, an undo function is possible to not overwrite the original tiddlers.
> But I am afraid duplication tiddlers in this way will result in huge file 
> size.
>
> --Mohammad
>
> On Thursday, February 28, 2019 at 6:19:57 PM UTC+3:30, @TiddlyTweeter 
> wrote:
>>
>> Mohammad
>>
>> Really excellent. Its working well and I haven't been able to get it to 
>> fail. It will have huge use I am sure.
>>
>> I do think an issue is UNDO.
>>
>> Let me show why ...
>>
>> On a balmy day SHE took advice that HE needed to walk.
>>
>> If we replace "SHE" with "HE" we get ...
>>
>> On a balmy day HE took advice that HE needed to walk.
>>
>> But it can't easily be reversed  just switching "find" & "replace" terms 
>> as you'd get ...
>>
>> On a balmy day SHE took advice that SHE needed to walk.
>>
>>
>> I think the simplest way to deal with this is that a Tiddler under s-n-r 
>> is cloned to a state tiddler before changes occur that can be RESTORED.
>>
>> What do you think?
>>
>> Best wishes
>> Josiah
>>
>>
>>
>> Could the tiddler/s you working on be 
>>
>> On Thursday, 28 February 2019 07:54:26 UTC+1, Mohammad wrote:
>>>
>>> Announcement: SNR
>>>
>>> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
>>> contents (including all fields) for a searchValue and replace them with 
>>> replaceValue.
>>>
>>> See the original post here!
>>>
>>> https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ
>>>
>>>
>>> Demo: https://kookma.github.io/search-n-replace/
>>>
>>>
>>> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/09fd5477-f08f-40f1-b8dd-d3e8f3a42ea6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Yes, an undo function is possible to not overwrite the original tiddlers.
But I am afraid duplication tiddlers in this way will result in huge file 
size.

--Mohammad

On Thursday, February 28, 2019 at 6:19:57 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad
>
> Really excellent. Its working well and I haven't been able to get it to 
> fail. It will have huge use I am sure.
>
> I do think an issue is UNDO.
>
> Let me show why ...
>
> On a balmy day SHE took advice that HE needed to walk.
>
> If we replace "SHE" with "HE" we get ...
>
> On a balmy day HE took advice that HE needed to walk.
>
> But it can't easily be reversed  just switching "find" & "replace" terms 
> as you'd get ...
>
> On a balmy day SHE took advice that SHE needed to walk.
>
>
> I think the simplest way to deal with this is that a Tiddler under s-n-r 
> is cloned to a state tiddler before changes occur that can be RESTORED.
>
> What do you think?
>
> Best wishes
> Josiah
>
>
>
> Could the tiddler/s you working on be 
>
> On Thursday, 28 February 2019 07:54:26 UTC+1, Mohammad wrote:
>>
>> Announcement: SNR
>>
>> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
>> contents (including all fields) for a searchValue and replace them with 
>> replaceValue.
>>
>> See the original post here!
>>
>> https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ
>>
>>
>> Demo: https://kookma.github.io/search-n-replace/
>>
>>
>> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/f6d5233d-3508-4d11-b1f2-453f5c80250f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Josiah,
 I can add a simple logic as whole word option but here whole word means a 
word separated from other part of the text by two spaces.

The problem is, it will fail to distinguish punctuation. So, it can find " test 
" but not " test!".

Anyway, snr can do many search and replace jobs, but one needs to be 
careful like the example you gave above!
he in she, shell, shelf, ...

If TW got a Javascript replace function, the code will be much simpler, if 
not using current TW features the logic will be
difficult to make whole words search.

--Mohammad

On Thursday, February 28, 2019 at 6:19:57 PM UTC+3:30, @TiddlyTweeter wrote:
>
> Mohammad
>
> Really excellent. Its working well and I haven't been able to get it to 
> fail. It will have huge use I am sure.
>
> I do think an issue is UNDO.
>
> Let me show why ...
>
> On a balmy day SHE took advice that HE needed to walk.
>
> If we replace "SHE" with "HE" we get ...
>
> On a balmy day HE took advice that HE needed to walk.
>
> But it can't easily be reversed  just switching "find" & "replace" terms 
> as you'd get ...
>
> On a balmy day SHE took advice that SHE needed to walk.
>
>
> I think the simplest way to deal with this is that a Tiddler under s-n-r 
> is cloned to a state tiddler before changes occur that can be RESTORED.
>
> What do you think?
>
> Best wishes
> Josiah
>
>
>
> Could the tiddler/s you working on be 
>
> On Thursday, 28 February 2019 07:54:26 UTC+1, Mohammad wrote:
>>
>> Announcement: SNR
>>
>> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
>> contents (including all fields) for a searchValue and replace them with 
>> replaceValue.
>>
>> See the original post here!
>>
>> https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ
>>
>>
>> Demo: https://kookma.github.io/search-n-replace/
>>
>>
>> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/c303bbed-b722-43a0-8b14-ddfb74a5ed5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Mario,
 I forgot to say, I am using the below template to have macro visible

https://kookma.github.io/search-n-replace/#%24%3A%2F.mr%2Fviewtemplate%2Fshow-contents-macro-tiddler

--Mohammad

On Thursday, February 28, 2019 at 3:51:14 PM UTC+3:30, PMario wrote:
>
> On Thursday, February 28, 2019 at 7:54:26 AM UTC+1, Mohammad wrote:
>>
>> Announcement: SNR
>>
>> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
>> contents (including all fields) for a searchValue and replace them with 
>> replaceValue.
>>
>
> Nice work!
>
> --- OT -
>
> It seems the tiddler folding mechanism has been broken with this tiddler 
> . 
>
> If you want to make $:/tags/Macro code visible just add the following 
> line at the end of the source code.
>
> <$view field="text"/>
>
>  It won't interfere with the code. BUT be aware, that doesn't work with 
> tiddlers used as templates!!
>
> have fun!
> mario
>
> PS: Kudos go to Eric Shulman
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/05bf8089-992a-4f25-9998-bacb70dfe416%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread Mohammad
Thank you Mario!

and I appreciate your comment.

Cheers
Mohammad

On Thursday, February 28, 2019 at 3:51:14 PM UTC+3:30, PMario wrote:
>
> On Thursday, February 28, 2019 at 7:54:26 AM UTC+1, Mohammad wrote:
>>
>> Announcement: SNR
>>
>> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
>> contents (including all fields) for a searchValue and replace them with 
>> replaceValue.
>>
>
> Nice work!
>
> --- OT -
>
> It seems the tiddler folding mechanism has been broken with this tiddler 
> . 
>
> If you want to make $:/tags/Macro code visible just add the following 
> line at the end of the source code.
>
> <$view field="text"/>
>
>  It won't interfere with the code. BUT be aware, that doesn't work with 
> tiddlers used as templates!!
>
> have fun!
> mario
>
> PS: Kudos go to Eric Shulman
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/60eb197b-f180-440e-a9f0-bccab898c2c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
Mohammad

Really excellent. Its working well and I haven't been able to get it to 
fail. It will have huge use I am sure.

I do think an issue is UNDO.

Let me show why ...

On a balmy day SHE took advice that HE needed to walk.

If we replace "SHE" with "HE" we get ...

On a balmy day HE took advice that HE needed to walk.

But it can't easily be reversed  just switching "find" & "replace" terms as 
you'd get ...

On a balmy day SHE took advice that SHE needed to walk.


I think the simplest way to deal with this is that a Tiddler under s-n-r is 
cloned to a state tiddler before changes occur that can be RESTORED.

What do you think?

Best wishes
Josiah



Could the tiddler/s you working on be 

On Thursday, 28 February 2019 07:54:26 UTC+1, Mohammad wrote:
>
> Announcement: SNR
>
> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
> contents (including all fields) for a searchValue and replace them with 
> replaceValue.
>
> See the original post here!
>
> https://groups.google.com/d/msg/tiddlywiki/lTYxRbGon1o/V8PVsvt1AgAJ
>
>
> Demo: https://kookma.github.io/search-n-replace/
>
>
> --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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/cb3d4938-0452-405c-9b47-daa37f438c37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
Email users ... An error in my test code was fixed


> !! Test of S-n-R ...
>
> >//''Instructions'': In the following, using steps in s-n-r: (1a) replace 
> "she" with "he" in all the variant case styles; (1b) replace the first 
> capitalised "HE" with "SHE"; (1c) replace the final capitalised "HE" with 
> "SHE"; (1d) replace "she" in '`...|shelperNote]]`' with "he". (2) Now, 
> using s-n-r steps, reverse it so your final text is __identical__ to the 
> starting text... AND without replacing anything in these 
> instructions at any point. //
>
> ---
>
> She sells seashells by the seashore.
> The shells she sells are surely seashells.
> So if she sells shells on the seashore,
> I'm sure she sells seashore shells.
>
> She resold shells to a shepherd. HE was in love with SHE.
>
> Though he did know of the [[Helper|shelperNote]].
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/12dca0d6-d93f-40e2-8b35-1f04787289a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread @TiddlyTweeter
Mohammad wrote:
>
> Announcement: SNR
>

Very good indeed! Thank you!

To fully test it I created a difficult test case. Its very achievable, but 
the user needs to pay careful attention step by step. Here is that test 
case ...

!! Test of S-n-R ...

>//''Instructions'': In the following, using steps in s-n-r: (1a) replace 
"she" with "he" in all the variant case styles; (1b) replace the first 
capitalised "HE" with "SHE"; (1c) replace the final capitalised "HE" with 
"SHE"; (1d) replace "she" in '`...|shelperNote]]`' with "he". (2) Now, 
using s-n-r steps, reverse it so your final text is __identical__ to the 
starting text... AND without replacing anything in these 
instructions at any point. //

---

She sells seashells by the seashore.
The shells she sells are surely seashells.
So if she sells shells on the seashore,
I'm sure she sells seashore shells.

She resold shells to a shepherd. HE was in love with SHE.

Though he did know of the [the Helper[shelperNote]].

Best wishes
Josiah

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/3eda2cfb-5c81-40f5-85d6-bf56bf92a36b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread PMario
fixed a typo in the last post :)

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/7c23f1bf-6e64-4bbe-9595-e8b05595db91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: SNR: Search and Replace in Tiddler Fields

2019-02-28 Thread PMario
On Thursday, February 28, 2019 at 7:54:26 AM UTC+1, Mohammad wrote:
>
> Announcement: SNR
>
> This is a simple script, search-n-replcae (*snr*) to search in tiddler 
> contents (including all fields) for a searchValue and replace them with 
> replaceValue.
>

Nice work!

--- OT -

It seems the tiddler folding mechanism has been broken with this tiddler 
. 

If you want to make $:/tags/Macro code visible just add the following line at 
the end of the source code.

<$view field="text"/>

 It won't interfere with the code. BUT be aware, that doesn't work with 
tiddlers used as templates!!

have fun!
mario

PS: Cudos go to Eric Shulman

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/e61f718a-7403-4784-9881-3834f5f5cc55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.