Alteryx Designer Desktop Discussions

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

RegEx - Help with syntax

CSmith16
8 - Asteroid

Hello,

 

I am trying to write a regular expression for a weekly challenge. I have an expression that separates the different date formats into different columns.

 

Here: 

 

 .*(\d{2}-\w+-\d{4})|.*(\u\w+\s\d+,*\s\d\d+)|.*(\d{2}-\w+-\d{2})

 

Spoiler
CSmith16_0-1686680244224.png

 

But, I cannot write a regular expression that separates record 13.

 

The record is as follows: 

 

"The best cure for insomnia is to get a lot of sleep.W.C.Fields4-SEP-00The quote field has a beginning but not a trailing double quote. This record could be rejected.

 

 

I do not want to use the expression posted as the solution as I am trying to do this as differently as possible. 

 

Any suggestions would be much appreciated.

2 REPLIES 2
CSmith16
8 - Asteroid

Got it. 

 

 

 

.*(\d{2}-\w+-\d{4})|.*(\u\w+\s\d+,*\s\d\d+)|.*(\d{2}-\w+-\d+)|.*(\d+-\w+-\d+)

 

 

Spoiler
CSmith16_0-1686683760170.png

 


 

 

CSmith16
8 - Asteroid

My solution feels wrong. I got the correct output but this feels like it is badly done. Any advice would be much appreciated. I did not understand the formula used in the solution posted, nor did I want to copy the same regular expression in the RegEx tool. I did the best I could while trying to do it as different as possible.

 

RegEx expression: 

Spoiler
.*(\d{2}-\w+-\d{4})|.*(\u\w+\s\d+,*\s\d\d+)|.*(\d{2}-\w+-\d+)|.*(\d+-\w+-\d+)

Workflow: 

Spoiler
CSmith16_0-1686686718177.png

 

Labels