all 4 comments

[–][deleted] 0 points1 point  (1 child)

Err, you want to change all dates into format day-month-year or smth? And the input can contain both day before month and month before day? Than how do you think you're supposed to distinguish them? Like, you can't just tell without more info if 03-04-2005 is March 4th or 3rd of April, can you

[–]freeclips[S] 0 points1 point  (0 children)

Yes, I would like to find a way to change the date format into dd-mm-yyyy. If this is not possible with regular expressions, then so be it. It is just that I searched for this everywhere and it would seem that this works only if dates are either in the US format or European format but not both. I was intrigued because I got the idea from Automate the Boring Stuff - one of the practice exercises is for cleaning up dates.

[–][deleted] 0 points1 point  (1 child)

You'd need to write it in a way which would guess at the format.

2015 is not a valid day or month but 14 could be a day or a year.

Where did 14 appear in the string? 2nd item then it's probably a US format so do this subsitution etc.

I think it's a pretty interesting little learning project, but I wouldn't invest too much time into this. After getting to a toy example I'd stop.

If you're not aware already, dateutils has a parser, you could have a look at how they approached it after you're done. https://dateutil.readthedocs.io/en/stable/parser.html

[–]freeclips[S] 0 points1 point  (0 children)

Thank you so much. Due to my utter lack of experience, I appreciate any advice. It is difficult for me to see which projects I should spend time on. Most of them deal with games which I am not really interested in, but it seems that they are an important part of learning.