ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Need help in Regex_Replace formula not Regex tool

RajatRehria
アステロイド

Hi Guys, I hope u all doing well.

 

I have a text as |Dividend income|66|25|78|1,256|361 and I want how can i get the values till second pipe from the end using Regex_Replace formula only (not via Regex tool),

required output is |1,256|361 please help with the Regex formula. Thanks.

10件の返信10
alexnajm
19 - Altair
19 - Altair

Done based on the requirements above!

 

REGEX_Replace([Data], ".*(\|.+\|.+)", "$1")

ShankerV
キャスター

Hi @RajatRehria 

 

One way of doing this.

 

REGEX_Replace([Field1], "(.+)(\|.+\|.+)","$2")

 

ShankerV_0-1680717676556.png

 

Many thanks

Shanker V

 

RajatRehria
アステロイド

Many thanks to both of you guys, it worked. Can u please help me in one more thing that how can I learn the RegEx the way you guys are expert, any book, cheat sheet, or article where i can learn from very basic to advanced then please let me know. Many thanks again.

alexnajm
19 - Altair
19 - Altair

I recommend practicing through regex101: build, test, and debug regex!

ShankerV
キャスター

Hi @RajatRehria 

 

@alexnajm suggestion is the best which I will also suggest too. In additional, you can also make use of the below.

 

https://www.youtube.com/watch?v=Mxx0Or8oBYc

 

Many thanks

Shanker V

RajatRehria
アステロイド

Thanks again :)

Meggan
メテオロイド

what if I want to pull everything to the right of the first space

FRLP72S 12
IHLE41AL 144
SFLM54AB 60

desired output from the above

12

144

60

alexnajm
19 - Altair
19 - Altair

@Meggan RegEx_Replace([Field], ".+\s(\d+)", "$1")

Meggan
メテオロイド

@alexnajm  worked beautifully - thank you!

ラベル
トップのソリューション投稿者