Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Regex Parse Help

SyedA
6 - Meteoroid

Hi,

 

I need help parsing this with regex:

 

e.a@c.com","DisplayName":"e,a ","Email":"e.a@c.com","Picture":"hps://sharepointco/_layouts/UserPhoto.aspx?Size=L&AccountName=e.a@c.com"

 

All i need from this is the DisplayName without quotations: e,a

 

How may I go about this?

 

9 REPLIES 9
Luke_C
17 - Castor
17 - Castor

Hi @SyedA 

 

I wouldn't use regex - I would do text to rows on commas, then text to columns on colons. From there the data is split out appropriately. Then I use a replace function to remove the quotes. 

 

Note, I used the below as sample data, the beginning of your sample seems to be cutoff or a copy of the email piece:

"DisplayName":"e,a ","Email":"e.a@c.com","Picture":"hps://sharepointco/_layouts/UserPhoto.aspx?Size=L&AccountName=e.a@c.com"

 

Luke_C_0-1627414918187.png

 

apathetichell
19 - Altair

this works for your sample data

regex_replace([Field1],'.*DisplayName":"(.*)\s".*',"$1")

SyedA
6 - Meteoroid

what parse regex formula could I use if I just wanted "DisplayName" and to remove everything else after?

 

"DisplayName":"e,a ","Email":"e.a@c.com","Picture":"hps://sharepointco/_layouts/UserPhoto.aspx?Size=L&AccountName=e.a@c.com"

Luke_C
17 - Castor
17 - Castor

Hi @SyedA 

 

You could try this, although I recommend my first solution to fully parse all the data, then you can filter as needed.

 

"DisplayName":"(.*)\s".*

 

Luke_C_0-1627418616641.png

 

 

 

apathetichell
19 - Altair

Did you try my formula? It worked in your sample data...

SyedA
6 - Meteoroid

it did not work

Luke_C
17 - Castor
17 - Castor

@SyedA Please share the sample data in excel or in a yxzp file mine and @apathetichell's solution are working fine for me.

apathetichell
19 - Altair

Did you put it in regex tool/parse or a regular formula field? Mine is designed for a regular formula tool... for a parse tool you'd put:

.*DisplayName":"(.*)\s.* in the parse tool - or something like that...

 

Can you confirm that there will be only 1 display name per record?

SyedA
6 - Meteoroid

this worked! thank you

Labels
Top Solution Authors