modify regex

This commit is contained in:
takumakanari 2016-03-18 16:23:09 +09:00
parent 334aab8a03
commit cfcb638156
1 changed files with 6 additions and 6 deletions

View File

@ -120,7 +120,7 @@ var (
min: 0, min: 0,
max: 59, max: 59,
defaultList: genericDefaultList[0:60], defaultList: genericDefaultList[0:60],
valuePattern: `[0-9]|[1-5][0-9]|0[0-9]`, valuePattern: `0?[0-9]|[1-5][0-9]`,
atoi: atoi, atoi: atoi,
} }
minuteDescriptor = fieldDescriptor{ minuteDescriptor = fieldDescriptor{
@ -128,7 +128,7 @@ var (
min: 0, min: 0,
max: 59, max: 59,
defaultList: genericDefaultList[0:60], defaultList: genericDefaultList[0:60],
valuePattern: `[0-9]|[1-5][0-9]|0[0-9]`, valuePattern: `0?[0-9]|[1-5][0-9]`,
atoi: atoi, atoi: atoi,
} }
hourDescriptor = fieldDescriptor{ hourDescriptor = fieldDescriptor{
@ -136,7 +136,7 @@ var (
min: 0, min: 0,
max: 23, max: 23,
defaultList: genericDefaultList[0:24], defaultList: genericDefaultList[0:24],
valuePattern: `[0-9]|1[0-9]|2[0-3]|0[0-9]`, valuePattern: `0?[0-9]|1[0-9]|2[0-3]`,
atoi: atoi, atoi: atoi,
} }
domDescriptor = fieldDescriptor{ domDescriptor = fieldDescriptor{
@ -144,7 +144,7 @@ var (
min: 1, min: 1,
max: 31, max: 31,
defaultList: genericDefaultList[1:32], defaultList: genericDefaultList[1:32],
valuePattern: `[1-9]|[12][0-9]|3[01]|0[0-9]`, valuePattern: `0?[1-9]|[12][0-9]|3[01]`,
atoi: atoi, atoi: atoi,
} }
monthDescriptor = fieldDescriptor{ monthDescriptor = fieldDescriptor{
@ -152,7 +152,7 @@ var (
min: 1, min: 1,
max: 12, max: 12,
defaultList: genericDefaultList[1:13], defaultList: genericDefaultList[1:13],
valuePattern: `[1-9]|1[012]|0[0-9]|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|march|april|june|july|august|september|october|november|december`, valuePattern: `0?[1-9]|1[012]|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|march|april|june|july|august|september|october|november|december`,
atoi: func(s string) int { atoi: func(s string) int {
return monthTokens[s] return monthTokens[s]
}, },
@ -162,7 +162,7 @@ var (
min: 0, min: 0,
max: 6, max: 6,
defaultList: genericDefaultList[0:7], defaultList: genericDefaultList[0:7],
valuePattern: `[0-7]|0[0-7]|sun|mon|tue|wed|thu|fri|sat|sunday|monday|tuesday|wednesday|thursday|friday|saturday`, valuePattern: `0?[0-7]|sun|mon|tue|wed|thu|fri|sat|sunday|monday|tuesday|wednesday|thursday|friday|saturday`,
atoi: func(s string) int { atoi: func(s string) int {
return dowTokens[s] return dowTokens[s]
}, },