Alteryx Designer Desktop Discussions

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

Help with RegEx

selsset97
7 - Meteor

Hi Community,

 

I have this list of project names with crashed characters.

I would like to have the following expressions changed:

  • Co_{2} to be replaced to CO2
  • Eor to be replaced by EOR. Here Eor has to be preceded by a space (\s) or a dash (\-). Please refer to the screenshots attached.

 

<Input>

selsset97_0-1669863290296.png

 

<Desired output>

selsset97_1-1669863317634.png

 

I am struggling to find a solution to this.

Any advice please?

 

Thank you!

3 REPLIES 3
flying008
14 - Magnetar

Hi, @selsset97 

 

Please see the formula:

 

REGEX_Replace(Replace([Plant], "Co_{2}", "CO2"), "(\s|-)Eor$", "$1EOR")

 

 

flying008_0-1669865745861.png

 

gabrielvilella
14 - Magnetar

You can do this with a simple find and replace.

grazitti_sapna
17 - Castor

@selsset97 , you can also use simple replace function to get your desired result. Please let me know if it was useful.

 

grazitti_sapna_0-1669867818047.png

 

Thanks.

Sapna Gupta
Labels