Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex_replace for text that contains + with space

Myusrename001
8 - Asteroid

Team,

if we have a text that contains - FUO20220511++2EKE+ceIM0INSFBC35231, this needs to be replace + with spaces. 

This is what my output should look like - (FUO20220511  2EKE ceIM0INSFBC35231 ). can anyone guide me. Thanks ! 

 

Thanks,

 

8 REPLIES 8
IraWatt
17 - Castor
17 - Castor

Hey @Myusrename001,

Don't need regex can just use the replace function in a formula tool:

IraWatt_0-1652359782724.png

 

Replace([Field1], "+", " ")

 

 

IraWatt
17 - Castor
17 - Castor

If you really want to use Regex you could do this:

(\++)

This will match with 1 or more +'s and replace it with a space

IraWatt_0-1652359926591.png

 

Myusrename001
8 - Asteroid

Hi @IraWatt Thanks -

but the output contains only one space, if we have ++ then it should show "  " (2 space), if we have 3 + then we need to have 3 space... likewise.

IraWatt
17 - Castor
17 - Castor

Hey @Myusrename001,

In that case just use this in the parse tool:

 

(\+)

 

 

Myusrename001
8 - Asteroid

@IraWatt  - My output will show as "FUO202205112EKEceIM0INSFBC35231" without spaces... can you please review.  

IraWatt
17 - Castor
17 - Castor

@Myusrename001 Make sure there is a space here:

IraWatt_0-1652363853419.png

This tells the tool what to replace the + with

Myusrename001
8 - Asteroid

Works Perfect ! Thanks so much @IraWatt 

IraWatt
17 - Castor
17 - Castor

No worries @Myusrename001 ! glad it worked :) 

Labels
Top Solution Authors