2019-04-02
as Tuesday 2nd April 2019.--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1808ec69-2ee7-460b-a6ca-43810a3ed824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
sep
parameter. Changed date to invalid-date <code>
Every year divisible by 4 is a leap year, except when it is divisible by 100 unless it is divisible by 400.
^((([1-9]\d{3})\-(0[13578]|1[02])\-(0[1-9]|[12]\d|3[01]))|(((19|[2-9]\d)\d{2})\-(0[13456789]|1[012])\-(0[1-9]|[12]\d|30))|(([1-9]\d{3})\-02\-(0[1-9]|1\d|2[0-8]))|(([1-9]\d(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))\-02\-29))$
Hi S.S., I got very intrigued by the regex in this neat little tool of yours! The regext has a couple of issues the are not immediately obvious on accurate matching for dates in February. I've written a new version that is easier to understand. It's also easier to set date ranges in it. I'm testing it at the moment and will post it when I'm sure it works reliably.Best wishes
Josiah
I just read that stack post in some detail. Thanks for that. And I've previously looked at the social and historical stuff. Especially on the different dates on which different countries transferred to Gregorian dates from Julian.
What has surprised me is you can actually get regex to match date systems perfectly accurately. But a problem with a lot of the yyyy-mm-dd regex around is they are not tested against enough dates. And most of them have problems. I been taking good bits of them to derive something fully workable.
For pragmatic use a Gregorian (leap on centennial only once in 400 years) regex from 1800 to 9999 could be totally accurate for English speaking countries (which went Gregorian in 1752). Other countries like France or Germany could have even earlier start centuries.
And a Julian (leap on all centennials) regex from 0001 to 1799 would be accurate as anything else---given all the complexity of actual historical usage (e.g. some countries had more than one type of year calender in use). Useful and accurate enough I think.
I also wanted to make it so you can change the start century without having to wade through the complexity of the regex.
I'll use a slightly different method on capture groups so they are easier to count in the forest of brackets. This makes handling the separators a lot easier.
The neat little tool of yours gave me opportunity to play with a nicely rich regex. Thanks again.
Another round of tests and I'll put it out.
Best
Josiah
timeA time string of up to 9 digits, 2 for hours, 2 for minutes, 2 for seconds, 3 for milliseconds (hhmmssXXX) applicable only when the date string includes a 2 digit day