Alteryx Designer Discussions

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

REGEX_Replace replace first , but not second

marksyoung73
6 - Meteoroid

Hi,

 

I'm new to REGEX and try to get my head around it.

 

In this example "Hard Rock Cafe International (USA), Inc.,1111-L"

 

How to I replace the , within a text but not a comma before the number starts?

 

thanks

3 REPLIES 3
atcodedog05
21 - Polaris

Hi @marksyoung73 

 

You can try Regex formula like below.

 

 

 

REGEX_Replace([Field1], ",([^\d])", "$1")

 

 

 

Remove all commas which is not followed by number. Comma (,) followed by Non number ([^\d]) is replaced with non number (i,e comma removed).

 

Workflow:

atcodedog05_0-1627922705232.png

 

Hope this helps : )

 

marksyoung73
6 - Meteoroid

This is great. Just wish I could understand the layout a little more.

Any idea the best place to learn this stuff?

Thanks very much

atcodedog05
21 - Polaris
Labels