Alteryx Designer Desktop Discussions

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

Regex expression error in Formula tool

ZoeyL1GL
8 - Asteroid

Hi,

 

Having a problem here - would be so much appreciated if anyone can provide the solution.

 

to identify any digit character(s) in a field and to replace with a string letter(such as F) to a string letter and any digit character(s):

Untitled picture.pngto   Untitled picture2.png 

I used Formula tool with an expression: REGEX_Replace([Column], "\d{0,}", "F\d{0,}")

 

tested the regex terms in Regexer.com, and it works well there. However, when applying the same expression on Alteryx, it gives me weird answers:

Untitled picture1.png

 

Or an any other function/tool would achieve the same result rather than using RegEx?

 

Any help would be appreciated!

 

Thanks in advance!

 

Zoey

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus
REGEX_Replace([Column], "(\d{1,})", "F$1")

Quick guess
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ZoeyL1GL
8 - Asteroid

@Marquee, thank you for your response! hmm, this seems still not working - it returns results like F for all lines. any further suggestions please?

MarqueeCrew
20 - Arcturus
20 - Arcturus

Capture.PNG

 

@ZoeyL1GL,

 

It seems to work for me.  Please help me to understand what I'm doing differently?

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ZoeyL1GL
8 - Asteroid

Thank you @Marquee! 

 

Sorry that was my mistake - I have missed the "()" in the line "(\d{1,})". I thought () didn`t do anything in RegEx. 

 

Many thanks, and it perfectly works now!

 

Zoey

Labels