you need to do it like this:

var re = new RegExp(forvar, 'g');for (; i <= max; i += iter) {
       textBuffer.push(text.replace(re, i));
}

all the best BJ
On Sunday, April 29, 2018 at 4:03:52 PM UTC+2, Bala Chandra wrote:
>
> It replaces only the first instance of the forvar .. So i tried to modify 
> the code of $:/plugins/tesseract/forloop/forloop.js  (
> https://ibnishak.github.io/Tesseract/pluginsandmacros/index.html#Simple%20for-loop%20macro
> )
>
>
>         for (; i <= max; i += iter) {
>             textBuffer.push(text.replace(forvar, i));
>         }
>
>
> to
>
>         for (; i <= max; i += iter) {
>             textBuffer.push(text.replace(/forvar/gi, i));
>         }
>
>
> However, even then the code doesnt do a global replace ... any ideas?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/b8fd3de8-14af-4da8-be28-47b906e25c62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to