Alteryx Designer Desktop Discussions

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

Find fist 10 numerical characters within string starting with '300'

ALT_2358
9 - Comet

I have a field that concatenates all the other fields in a dataset.

 

Within this field, there are 10-digit codes all starting with '300' which I need to extract. I came up with one solution which works except on rows containing other numbers starting with 300, e.g. £3000. It would only work if the 10 digit code appears before the unwanted number.

 

Is there a way to do this?

 

Thanks

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

@ALT_2358 ,

 

 please try this regular expression:

 

Regex_Replace([text],".*?(300\d{7}).*",'$1')

 

it might help you. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ALT_2358
9 - Comet

Thanks for the quick reply. 

 

This is my first time using the RegEx tool so I'm probably just doing something wrong, but I'm struggling to get the right output using this formula. 

 

I've tried selecting all the different output methods (parse, match, etc.) but I'm either getting no output, nulls or 'False' on every line. 

 

Thanks

ALT_2358
9 - Comet

I've attached a sample workflow  if it helps. 

 

Thanks

deviseetharaman
11 - Bolide

Hi @ALT_2358 

 

@MarqueeCrewgave the regex expression inside the regex_replace() function. This you can use with Formula tool. If you want to use Regex Parse tool, then give only the regex expression - .*?(300\d{7}).*

ALT_2358
9 - Comet

Amazing! That worked perfectly, thank you both so much!!!

Looks like I have a lot to learn haha!

Labels