Alteryx Designer Desktop Discussions

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

Regex words and spaces

hudg16
7 - Meteor

I am trying to grab device names from a list of accessories, but some include multiple device names. iPhone 11/XR

If it weren't for those doubles I just use (\w+\s+\w+), but I need to then include word, space, word/word. Where it gets tricky is that some are triple, 7/8/SE

IPHONE 12/12PRO BLU-ELEMENT CHRY BLSM > Want return IPHONE 12/12PRO

IPHONE 7/8/SE ROOTS 9 CARD FOLIO WALLET > IPHONE 7/8/SE

IPHONE 7/8+CASECO BROADWAY ST FOLIO R GD > IPHONE 7/8+

 

SAMSUNG S21+ BOND ST II FOLIO BLACK > SAMSUNG S21+

 

Any good ways to do this?

2 REPLIES 2
Drussek
9 - Comet

There are many different possible combinations. For your sample data, my solution returns a good result, but I think it will return wrong for many. Eg. "plus" that will not be at the end.

But maybe my solution will be useful for you?

mceleavey
17 - Castor
17 - Castor

Hi @hudg16 ,

 

You can adjust my previous solution to a slightly different problem:

 

(^.*?\s.*?[+]|^.*?\s.*?\s)

 

mceleavey_0-1623083933363.png

 

mceleavey_1-1623083958811.pngmceleavey_2-1623083983559.png

This method says, take everything from the beginning of the line to the first space, then from the first space the plus sign OR, from the the first beginning of the line to the second space.

 

Hope this helps,

M.

 

 

 

 



Bulien

Labels