We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

Challenge #4: Date Parsing

Elias_Nordlinder
11 - Bolide

Solved, fun little exercise.

 

Spoiler
Elias_Nordlinder_0-1626097477052.png
j_christian
7 - Meteor
Spoiler
Regular expressions and DateTimeParse make this less difficult than it looks.  However, if this was a real request for parsing out datetime from lots of strings, I'd advise using a library instead of writing the regular expressions, since these expressions will also pull nonsense strings of text and digits that match the date format..
ExploreMore
8 - Asteroid
Spoiler
First one I've solved in a while. I managed to solve using just one RegEx and Formula tool!


BobHaan
5 - Atom
Spoiler
BobHaan_0-1627575447345.png

 

 

I used two different RegEx expressions to pull out the dates:


(\d{1,2}[- ][a-zA-Z]{3,10}[- ]\d{2,4})       parses 16-APR-2005, 4-SEP-00

    ⦁ 1 to 2 digits                                                 \d{1,2}
    ⦁ either a dash ("-") or a space (" ")    [- ]
    ⦁ 3 to 10 letters                                           [a-zA-Z]{3,10} ---OR--- \D{3,10} ---OR--- [[:alpha:]]{3,10}
    ⦁ either a dash ("-") or a space (" ")    [- ]
    ⦁ 2 to 4 digits                                                 \d{2,4}

([a-zA-Z]{3}\s\d{1,2}[,]{0,1}\s\d{2,4})     parses Nov 16, 1900, Jan 5 2000

 

    ⦁ 3 letters                                                        [a-zA-Z]{3,10} ---OR--- \D{3,10} ---OR--- [[:alpha:]]{3,10}
    ⦁ a space (" ")                                                  \s
    ⦁ 1 to 2 digits                                                 \d{1,2}
    ⦁ an optional comma                                [,]{0,1}
    ⦁ a space (")                                                    \s

    ⦁ 2 to 4 digits                                                 \d{2,4}

 

I then use a formula to convert the RegEx Results into a useable date field:

 

BobHaan_1-1627575447416.png

 

This is one of the shorter solutions.  Note that the two RegEx functions could be combined into a single tool.

IraWatt
8 - Asteroid

Maybe not the most efficient way but managed to parse them all. 

Spoiler
IraWatt_0-1627646579991.png

 

 

carmenrapariz
8 - Asteroid
Spoiler
Challenge 4.PNG
caitlynmcintyre
6 - Meteoroid

I truly think this could be done in one tool but RegEx hurts my brain

Spoiler
caitlynmcintyre_0-1627969146149.png

 

MikeDroog
6 - Meteoroid

not the most elegant without a date parse tool but it works

FrederikF
Alteryx
Alteryx
Spoiler
FrederikF_0-1628069855015.png

 

JXEC
7 - Meteor

RegEx is my bane.

 

Here's my solution.