Start Free Trial

Alteryx Designer Desktop Discussions

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

Splitting Numeric + Alphabets values from String

sparkle
7 - Meteor

Hello, I am trying to use regex tool to get expected output from given "field1" values. Can you please someone help with regular expression to get expected output provided in "expected OP1" column.

 

Field1expected OP1
QDT1200MT1200M
RX_9070XT9070XT
QDP400P400
RTX4060TI4060TI
RTX4070TIS4070TIS
RTX4080S4080S
RX_9060XT9060XT
GFGTX16501650
RTX3060TI-LHR3060TI-LHR
7 REPLIES 7
CoG
14 - Magnetar

What are the rules that define what you want to parse out? I don't see a clear pattern among the prefixes being removed from your sample data. (Specifically, the first and third cases where a single letter is kept, unless the 'Q' indicates to keep an extra letter?)

jrlindem
12 - Quasar

I agree with @CoG .  Otherwise, you're going to need to build out a series of rules that account for each of the derivatives you're looking to remove.  First pass would be parsing at the underscore ("_"), then you'd have to pull "QDT" and "QD" and "RTX" and "GFGTX" but as it stands there's no pattern yet to use REGEX against.

dreldrel
9 - Comet

I think the easiest way is to use the Find and Replace tool to have a list of values you'd like to replace. In this case, you dont need a regex tool and you can get the same output

Find ValueReplace Value
QDEmpty
RX_Empty
RTXEmpty
GFGTXEmpty

 

flying008
15 - Aurora

Hi, @sparkle 

 

FYI.

Spoiler
([PT]?\d+.*)$

录制_2025_10_21_09_07_48_453.gif

jrlindem
12 - Quasar

Well done, @flying008 

I didn't catch the pattern stemming from the right side of the string.  Clever.

I am still curious, though, whether this REGEX you provided is going to work for the author's needs at scale (more values and potential variety).  But it certainly addresses the specific examples that were provided.

flying008
15 - Aurora

 

Dear @jrlindem , hello!

IMHO, I suspect @sparkle's goal is to extract the graphics card model value from a string (minus the manufacturer and series prefix). Based on the current naming conventions of AMD and NVIDIA, the regular expression above should match most models, barring some specific ones. However, as long as @sparkle can clearly explain his needs (what he wants and what he doesn't want), a slight refinement of the regular expression should make it applicable to all scenarios.

 

jrlindem
12 - Quasar

@flying008 - Yes, I think you're absolutely right!  Brilliant observations and explanation.  And thanks for the responses.  It's been a fun one to ponder and see how you've solved for it.

 

@sparkle if this solved it for you, be sure to mark flying008's response as the solution!

 

Cheers, -Jay

Labels
Top Solution Authors