Hi,
I’m struggling with a regex, I have a string that contains a lot of \n , which I want to get rid of. So I use the replace method with storeEval as follows : var r=storedVars['just'];r.replace(/\n/g,' ');r;
(just is the string previously stored )
So when I run the program I expect to get a string without any \n, but all I get is this error :
Error in runEval code: unterminated regular expression literal
When using any other regex, it works fine , but for this specific case, it does not.
Thanks for any help or advice,
Thank you for your reply. Here is the code for an example :
“Commands”: [
{
“Command”: “store”,
“Target”: “\na lot of \n \n \n that need to be \n removed \n”,
“Value”: “s”
},
{
“Command”: “storeEval”,
“Target”: “var r=storedVars[‘s’];r.replace(/\n/g,’ ');”,
“Value”: “s”
},
{
“Command”: “echo”,
“Target”: “${s}”,
“Value”: “”
}
]
Hello,
it seems that the Kantu IDE has a hard time managing objects that contain linebreaks such as \n. Could you please tell me if this issue would be resolved in the next update , if possible ? And if so, when would that be? Thanks for understanding,
Yes, we try to resolve it with the next update. The next beta version is planned at the end of this week already. So your bug report comes at a good time