Posts: 13
Threads: 6
Joined: Sep 2024
04-05-2025, 03:30 AM
(This post was last modified: 04-05-2025, 01:43 PM by linkiddx.)
I need to transform "[65]" string into "[ 65]" in QM.
But QM interprets "[65]" as character code for 'A', not as "[" + "6" + "5" + "]" sequence.
So, this simple code doesn't work:
_s = "[65]"
_s.replacerx("\[" "[ ")
But how do I get "[ 65]" from "[65]" then?
Is there any way of spliting 'character code strings' into individual characters?
Thanks for the answer!
Posts: 12,148
Threads: 143
Joined: Dec 2002
_s = "[91]65]" ;;91 is character code of '['
out _s
Posts: 13
Threads: 6
Joined: Sep 2024
Thank you for your answer!
Actually, I know how to use escape characters and character codes in regular expressions.
Still, this one doesn't work for me.
For example, i need to transform "[65]: example string" into "[ 65]: example string".
"[65]" substring is not character code for 'A' in this case, it's just a text string.
The question remains to be answered:
How do I change "[65]: example string" into "[ 65]: example string" using regular expressions?
Posts: 12,148
Threads: 143
Joined: Dec 2002
04-05-2025, 08:51 AM
(This post was last modified: 04-05-2025, 08:53 AM by Gintaras.)
In this case your replacerx code works. But you can use [91] in regex string too if need.
_s = "[91]65]: example string"
_s.replacerx("\[" "[ ")
out _s