We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx - Help with syntax

CSmith16
9 - Comet

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
9 - Comet

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
9 - Comet

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
Top Solution Authors