@russian-dima This is because it’s rich text. Rich text value is an html so you need to use the html that stand for the quotation mark, which is " for double-quote and ' for the single-quote.
@jonatandor35
Damn! But i already tried this → called → ESCAPE and it did not work, for me.
But now doing it a second time → "èt-voilà !!! —> it worked!
BTW: I found once a good site for all the ESCAPES, but lost it again. Do you know a good site, where i can find all the ESCAPES (i call them → ESCAPES , because i do not know the right name for it).
@russian-dima Next time you should console.log() the values. Had you done it, you could have found the real characters.
When you say “escapes” do you mean character encoding?
@jonatandor35
I mean some listed “escapes” like listed in this example-table, but what i have lost, was a much better table, with all existing → “escapes”
Ok, i think i have to expand my question a little bit.
What i am trying to achieve?
For example i have a text like…
"This is my example text about[JavaScript-programming]. I have to say, that JavaScript is a very interesting[programming-language]and it makes a lot of fun to code with[JavaScript]. I can’t live without JavaScript anymore."
Ok, we have our STRING-TEXT.
Now i want to search for all STRING-TEXT, which is located between the two → [ ]
This part was no problem…
$w.onReady(function () {
let myString = "This is my example text about [JavaScript-programming]. I have to say, that JavaScript is a very interesting [programming-language] and it makes a lot of fun to code with [JavaScript]. I can't live without JavaScript anymore.";
let foundStrings = myString.match(/\[(.*?)\]/g);
for (let i = 0; i < foundStrings.length; i++) {
const stringElement = foundStrings[i]; console.log(stringElement)
}
});
All wanted [part-string]s were detected/found and put into an array.
And it would also not be the problem to replace all of the found strings → for example by another single string like → “xxxxxx”, or what ever.
But how i can now replace each individual found STRING with an individual valued STRING. ???
For example if i want to replace → “JavaScript-programming” → to → “Phyton-programming” ?
And if i want to have instead of → “programming-language” → “coding-language” ?
And the third found string should be changed from → “JavaScript” → to → “Ruby” ?
@russian-dima hi, “escape” is when you need to set a new meaning (functioning) to a certain character,
for example in JS when you wish to represent the ’ character itself and not to use it as string literal, you add a back slash like: "
But here we talked about the html name of specific encoded characters. For that you can see for example these tables (and others):
@jonatandor35 Ok, thanks for clarification J.D. Now all makes sence to me.
Sometimes it’s strage. I do not know about some things, but i already can use them
And yes, this is a similar table, which i was talking about. Thanks!
@J.D. Sorry, but still some not understandable issues with RegEx.
let foundStrings = strTEXT . match ( / ("(.*?)") / )
Gives back wrong RESULT…
Normaly the RESULT should be → “variable1” and not “;variable1”
Also, if taking a look onto the results, there is something strange…
Instead of one RESULT i get two [0,1]. Why?
That unexpected behaviour destroys my logical way of thinking.
The logical way would be like in this example here, when using →
Clean, logical & understandable result!
Who can shed some light on this behaviour ?
How to modify it to get JUST → variable1 without quotation-marks and avoiding the first[0] RESULT ?
I have done a lot of attemptions to get your suggested CODE working and implementing into my code, but could not get it to work. So i searched for my own way of doing it.
At the end i could solve a lot of issues related to the regEx-syntax (thanks again on this part).
But i switched back to a normal Text-Field instead of using the RTB .
To to disclose the secret, i am working on my own creating of a → CODE- BEAUTIFIER/FORMATTER/ANALYSER/CORRECTOR in one.
But still have some issues, especialy when using rexRex for unescaped characters like → $ or → .
For example if we would have some CODE, which should get formatted …