Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAGave regex a workout
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?
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?
Challenge #45
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.
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.