Skip to main content
Navigator | Tier 3
March 21, 2025
Solved

Handling special characters

  • March 21, 2025
  • 3 replies
  • 399 views

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?

    Best answer by madhu subbegowda

    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.

    3 replies

    Aaron.Gleason
    Automation Anywhere Team
    Automation Anywhere Team
    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
    Most Valuable Pathfinder
    March 22, 2025

    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.

    Madhu Kumar T S || https://www.linkedin.com/in/madhukumarts/
    Cadet | Tier 2
    August 26, 2025

    [^\x20-\x7E] did the trick for me. [\s\xA0]+ or [\xA0\s]+ did not function