Skip to main content
Question

Handling special characters


Forum|alt.badge.img+6

Hello all,

 

I have a feeling this is a long shot but thought i would ask none the less. We have a bot that reads in the contents of an email  which contains a list of information in the format <LABEL>: <VALUE>.

Unfortunately, sometimes there are hidden special characters after a value. If I were to manually highlight the value in the email i can tell there are special characters usually by the fact there is more than one space after the value. The bot reads in the value along with its special characters which then causes problems later on in the code. I don’t suppose there is any way to check for and weed out special characters in an email?

2 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 517 replies
  • March 21, 2025

Not at my computer, but maybe a regex that includes all standard ASCII characters and replaced everything outside those bounds with nothing.


madhu subbegowda
Most Valuable Pathfinder
Forum|alt.badge.img+8

The possible hidden characters are due to nbsp values. To remove any hidden characters and replace with nothing and the additional.blank spaces pass the string and call this regex code. This should solve the problem: [\s\xA0]+ or [\xA0\s]+

 

\s will remove white or blank spaces and \xA0 will check for nbsp values and replaces with nothing.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings