Alteryx Designer Desktop Discussions

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

Removing leading and trailing numbers from string

ignas
アステロイド

Hey there

 

I need your help with removing leading and trailing numbers from string.

Input

45 Apple 7 bad 741, 78954, 7896

1 Banana 676 Good 987, 741 963

 
Output

 

Apple 7 bad
Banana 676 Good

Do we have any regex experts who can help me? :)

4件の返信4
LordNeilLord
オーロラ

Hey @ignas

 

In the formula tool try this: REGEX_Replace([Field1], "(\d+\s)(\w+\s\d+\s\w+)(.*)", "$2")

jdunkerley79
ACE Emeritus
ACE Emeritus

An alternative to @LordNeilLord

REGEX_Replace([Field1], "(^[0-9 ,]+|[0-9 ,]+$)", "")

 

This just replaces numbers at start and end 

ponraj
パルサー

Here is the sample workflow for your case.  Hope this is helpful. 

 

WorkflowWorkflowResultsResults

ignas
アステロイド

Hello @LordNeilLord,

 

It removes only from some of them.

ラベル