> This is a good opportunity, the deserializer code is very simple ...
>> ... you need to do a String.replace 
>> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace>
>>  
>> to replace the characters not allowed in tiddler titles.
>>
>
> Right! It would be useful to see an example of String.replace in the code. 
> Is that using REGULAR EXPRESSIONS? 
> If so there I can help too. But I can't really read JS code. But I'm sure 
> Mohammad will quickly learn how to :-)
>

 @TT yes I believe Mohammad will be up and running quite easily, at least 
with the basics and that is where it all starts. That is how I got started 
with JavaScript as well many a year ago in the now defunct TW-Dev group.

String.replace can accept both a single string argument specifying what to 
replace, as well as a regular expression. 
Copying the examples below from the MDN link 
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace>
 
I posted earlier, note how the second example uses a regular expression to 
specify what to replace:

const p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, 
was it really lazy?';

console.log(p.replace('dog', 'monkey'));
// expected output: "The quick brown fox jumps over the lazy monkey. If the 
dog reacted, was it really lazy?"

const regex = /Dog/i;
console.log(p.replace(regex, 'ferret'));
// expected output: "The quick brown fox jumps over the lazy ferret. If the 
dog reacted, was it really lazy?"
 
 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ced22fff-d35f-497e-a797-cfa8d18c9016n%40googlegroups.com.

Reply via email to