This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I'm working on a module that includes a geocoder tool. I'm running into an issue in which the data the users are submitting to the module are copied from a web page and sometimes include weird characters (e.g. ASCII 160). This causes the geocoder problems. And by problems, I mean that the geocoder can only find the zip code when without the odd characters, it can find the address.
What I'm looking for is the most elegant way to remove any characters from a text value that fall outside of the ASCII range of 32 -126. Any characters inside that range *shouldn't* cause the geocoder problems.
Extra cool points to anyone from Alteryx that will fix incorporate this fix into the Address tool. :-)
I am definately in need of some extra cool points, so here is my most elegant way to remove ASCII characters outside of the range of 32-126. I was able to remove the undesired characters using RegEx (you can use the RegEx tool or the Formula tool for this) using the following expression:
Everything within the brackets represents a specific set of characters to match. The x switch matches an ASCII charater using hexidecimal representation. x20-x7e translates to ASCII characters 32-126. The ^ preceeding the range indicates that we want to match anything NOT in the specified range. The + outside the brackets indicates that we want to search for this pattern in our string 1 or more times.