Weekly Challenges

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

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

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #4: Date Parsing

Tberney
8 - Asteroid

Gave regex a workout

Spoiler
Tberney_0-1595001807709.png

 

Tberney
8 - Asteroid

Hi, everyone. Just posted my solution.

 

Then I went to look at the solution provided, and Google decided to block the download: ....yxmd may be dangerous, so Chrome has blocked it".

 

I've downloaded dozens of these and this is the first time this has happened. Anyone else have the experience?

manjarigoyal1975
7 - Meteor

Solution for Challenge #4

DemandEngineer
8 - Asteroid

Hi I was thinking the same as you but I found Designer acting strangely... did you find the same? Is it a bug? or am I misunderstanding how RegEx works... please help me understand.

 

This is what I ended up using:

.*(\d{2}-[[:alpha:]]+-\d{2,4}).*|.*(\d-[[:alpha:]]+-\d{2,4}).*|.*([[:alpha:]]{3}\s\d{2},\s\d{4}).*|.*([[:alpha:]]{3}\s\d{1,2}\s\d{4}).*

 

Because it didn't parse  properly when I used this at the beginning

.*(\d{1,2}-[[:alpha:]]+-\d{2,4}).*

 

Also didn't know how to handle the variation where there was a comma and space after the day of month and no comma just a space...  So I just repeated most of the pattern and made another variation.

 

I would lose the first character of the date each time... is it trying to minimize what is matched?  If yes, is there a better way to write this without so much overlap?

DemandEngineer
8 - Asteroid

This was good learning... I wasn't familiar with RegEx.  My solution used multiple run of the DateTime tool to keep things simple vs formula that might need troubleshooting if things go awry.

sumanthskumar
8 - Asteroid

Challenge #45

Spoiler
sumanthskumar_0-1595074479304.png

 

mihir_sampat
7 - Meteor

Pretty sure not the best solution out there. Couldn't figure out the regular expression in one single line so used multiple regular expression and came up with a solution. Any constructive criticism is very appreciated. 

 

 

Spoiler
Challenge 4 solution.PNG

 

dhmalik
5 - Atom

My solution for the Challenge 4.

dmhatchell
7 - Meteor
Spoiler
dmhatchell_0-1595613659371.png

 

My RegEx capability is almost non-existent. So I took the first tool in the solution to get the dates out. But otherwise used my own solution for the rest of it.

LHolmes
9 - Comet

Had some fun with RegEx on this one and was able to get my parsing down to (A|B).

 

Spoiler
004- Solution.PNG