Page 1 of 1

Unmatched Escape Characters {

Posted: Tue Dec 04, 2018 11:24 pm
by Kroh
I'm currently trying to extract randomly generated passwords from an outlook email. The issue I'm running into is grabbing the left bracket escape character. Is there any way of extracting the left bracket or does Ranorex just get upset when it encounters it?

Re: Unmatched Escape Characters {

Posted: Wed Dec 05, 2018 8:42 am
by odklizec
Hi,

Could you please describe in more details, what exactly do you want to achieve? You can do whatever you want with strings in Ranorex, either using code or regexes. The problems is, that without more details (maybe even Ranorex snapshot or example of text you want to process), it's pretty hard to suggest something reliable ;)

Re: Unmatched Escape Characters {

Posted: Wed Dec 05, 2018 9:48 pm
by ahoisl
I guess you refer to the the exception "Unmatched escape character '{' found at..." that is thrown when you pass a key sequence to a Press method containing a '{' character. The curly brace '{' character is used in key sequences to signal an escape group that specifies repeated or special characters (see here for more info). Therefore, the '{' needs to be escaped by another '{', i.e. "{{", to output a single "{" in the UI.

My guess is that you want the '{' to be really typed into a text field by Ranorex and not use it to specify some special characters. You can simply escape a text in order to output it literally by calling the Keyboard.EscapeSequence method on the string.

Regards,
Alex
Ranorex Team

Re: Unmatched Escape Characters {

Posted: Wed Dec 05, 2018 11:27 pm
by Kroh
Alex,

That was exactly what I was having issues with, sorry for giving a less than informative description. That method solves the problem of inputting the key sequence into a textbox without Ranorex getting upset.

Thanks for the help!