Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IF Replace specific place of a string

Stuey
6 - Meteoroid

Hi

 

I'm trying to sort out some manually entered UK postcodes. 

The sample I have should be in the format a/a/n/n n/a/a OR a/a/n n/a/a      a=alpha n=numeric

For example: XZ18 7BB and S10 0AB

 

In the data set some of the postcodes have been incorrectly entered and have Os instead of 0s - and vice versa. I was wondering if there is a way to pick a particular part of the string and say that if it is "X" replace with "Y". 

 

In my case, replace "o" with "0".

 

E.g. NB25 OAT ---> NB25 0AT

 

Is this possible?

Thanks

Stuart

3 REPLIES 3
benakesh
12 - Quasar

Hi @Stuey ,

Try  regex parse  ( to  split string ) and regex replace .

Stuey
6 - Meteoroid

That has worked brilliantly, thanks @benakesh !

 

Seems like it'd be very beneficial for me to learn the capabilities of RegEx.

benakesh
12 - Quasar

Hi @Stuey ,

You can test expressions online  https://regexr.com/    and  then use the expression in Alteryx .

For reference :  https://www.regular-expressions.info/tutorial.html   

Labels