We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex_Replace formula

RajatRehria
8 - Asteroid

Hi Guys, i want to remove everything in a string after first pipe ( | ) character (including pipe) using Regex_Replace formula, please help. Thanks.

 

Input: ABC LTD CRM BA YUNN FC XYZC|RUN TIME : 01/15/2023 02:57|12345678

 

Output: ABC LTD CRM BA YUNN FC XYZC

5 REPLIES 5
DataNath
17 - Castor
17 - Castor

Hey @RajatRehria, there's no need for RegEx here really - can do this quite easily with regular string functions!

 

Left([Input],FindString([Input], '|'))

 

Just replace the two [Input] references with your actual field.

Felipe_Ribeir0
16 - Nebula

Hi @RajatRehria 

 

You can use this formula:

REGEX_REPLACE([INPUT], '(.*?)(\|.*)', '$1')

reggggg.png

RajatRehria
8 - Asteroid

Many thanks to @DataNath and @Felipe_Ribeir0  for the solutions.

PhilipMannering
16 - Nebula
16 - Nebula

I like @DataNath solution. The simpler regex would be,

REGEX_Replace([Test], '\|.*', '')
Meggan
6 - Meteoroid

what tweak would be needed to pull only the numbers to the right of a field? 
BPGM48B3 210 output 210
MECL20X7 1 output 1

Labels
Top Solution Authors