Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!
Free Trial

Alteryx Designer Desktop Discussions

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

Regx

anupgupta12
Asteroide

Can someone explain highlighted portion of below reg expression?

 

 Input -          It's going to be great great day   output - It's going to be great day

 

\b(\w+)\s\1\b

4 RESPOSTAS 4
atcodedog05
22 - Nova
22 - Nova

_

atcodedog05
22 - Nova
22 - Nova

Hi @anupgupta12 

 

I got it. Thought i remember it from somewhere. The expression should be something like this.

 

 

REGEX_Replace([Field1], "(\b\w+\b)\s\1", "$1")

 

 

Workflow:

atcodedog05_1-1627058680731.png

 

\b - word wrap

\w+ - word

\b - word wrap

\s - space

\1 - same word as in bracket

 

Basically, if a word is repeated it reduces to one.

 

Hope this helps : )

anupgupta12
Asteroide

How did you come to know \b means word wrap, i don't see it in regex. Can you please tell me?

atcodedog05
22 - Nova
22 - Nova

Hi @anupgupta12 

 

Agreed its not there in the Regex tool's list. There are lot which can be used which is not there in the list. Refer this website>cheatsheet section it will give you idea about regex usages. Regex is mostly common across lot of languages.

https://regexr.com/

 

atcodedog05_0-1627110320352.png

 

Hope this helps : )

Rótulos
Autores com maior número de soluções