DStraathof Posted August 2, 2019 Share Posted August 2, 2019 Hi, I'm searching for a solution to multi-escape the AutoIT special characters, like !, ^, { and }. I've created a Loop through the given string using the help from most of the members here, but it keeps bugging me with re-escaping already escaped characters, like { and }. Here's what I have up until now: $sPassword = "W@l}c0me{123)}ab!+25^}" $sGoodpassword = $sPassword ConsoleWrite($sGoodpassword & @CRLF) Local $a_rep[6][2] = [["{", "{{}"], ["}", "{}}"], ["!", "{!}"], ["#", "{#}"], ["+", "{+}"], ["^", "{^}"]] For $i = 0 To Ubound($a_rep, 1) - 1 $sGoodpassword = StringRegExpReplace($sGoodpassword, "\Q" & $a_rep[$i][0] & "\E", $a_rep[$i][1]) ConsoleWrite($sGoodpassword & @CRLF) Next It starts with this output (the original string of course):W@l}c0me{123)}ab!+25^} It ends with this:W@l{}}c0me{{{}}123){}}ab{!}{+}25{^}{}} As you can see, the first few curly braces are re-escaped.... All the help will be appreciated. Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted August 2, 2019 Developers Share Posted August 2, 2019 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted August 2, 2019 Share Posted August 2, 2019 Hi, Can you explain how you intend to use this string? If you're just using the Send function, then you could use the original string and set the optional flag parameter to $SEND_RAW. Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DStraathof Posted August 2, 2019 Author Share Posted August 2, 2019 Hi, Yes, I'm using the Send() function to put it in the appropriate application. I've changed it to the following: Send($sPassword, 1) ; The original string.... And it works! Thank for your quick and clear reply 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now