community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

RegEx Tool Help

Meteoroid

I'm having trouble using RegEx Tool to pick out codes from my text. Below is a sample of 2 text strings that I need to identify specific procedure codes from. The procedure codes are specific in this example but could be any procedure code that starts with a D and has 4 numbers after it.

 

ANALYSIS OF SALIVA SAMPLE FOR DIAGNOSTIC PURPOSES (D0418)
MAINTAINER D1550 AND REMOVAL OF FIXED SPACE MAINTAINERS

 

In this case I need to parse out D0418 on first line and D1550 on second line.

 

I thought something like this might work (\<[{D}]+,[\d{4}$]) and it runs without error but I don't actually parse out the procedure codes.

 

Any suggestions?

 

Thank you.

 

Alteryx Certified Partner
Alteryx Certified Partner

Hi @jokeffer 

 

You can use the Parse method with the REGEX tool and apply this formula:

 

(D\d+)

 

Cheers,

Meteoroid

Thank you and really that simple! Will that still work if there were multiple procedure codes say like D1550, D1551, D1552 in one of those statements?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@jokeffer 

 

No, it wouldn't.

 

You would have to use the Tokenize function splitting to rows if you had multiple records within a line.

 

Cheers,

Meteoroid

Outstanding, I see how that works now. Thank you again!!!

Labels