Improve regex and test for days of the week

This commit is contained in:
Matt Snider
2019-01-21 12:12:49 +01:00
parent d899d1a40f
commit aa48ea1d3c
2 changed files with 88 additions and 9 deletions

View File

@ -65,7 +65,7 @@ _PERIOD = r'(?P<period>hour|day|week|month|year)s?'
_EVERY = r'ev(ery)?'
_CYCLES = r'((?P<cycles>\d+)(st|nd|rd|th)?)'
_SIMPLE = r'(?P<simple>daily|weekly|monthly|yearly)'
_DOW = r'((?P<dayofweek>(mon|tues|weds|thurs|fri|sat|sun))(day)?)'
_DOW = r'((?P<dayofweek>(mo(n(day)?)?|tu(e(s(day)?)?)?|we(d(s|(nes(day)?)?)?)?|th(u(rs(day)?)?)?|fr(i(day)?)?|sa(t(urday)?)?|su(n(day)?)?)))'
# A single cycle recurrence is one of:
# - daily, weekly, monthly, yearly