|
|
|
@ -13,7 +13,7 @@ func matchPeriodPattern01(base time.Time, str string) (startimer.StarTimer, erro
|
|
|
|
|
str = transChn(str)
|
|
|
|
|
var rpt startimer.Repeats
|
|
|
|
|
var duration time.Duration
|
|
|
|
|
reg := regexp.MustCompile(`(每隔|每)?(\d{0,4}年)?(\d{0,5}个?月)?(\d{0,4}[明后大]{0,4}[日号天])?([上中下午夜早凌清晨傍晚里]+)?(\d{1,4}个?[点小时钟:]+)?(\d{0,4}[半分:秒]?钟?)?(\d{0,10}秒?钟?)?(后)?`)
|
|
|
|
|
reg := regexp.MustCompile(`(每隔|每)?(\d{0,4}年)?(\d{0,5}个?月)?(\d{0,4}[明后大]{0,4}[日号天])?([上中下午夜早凌清晨傍晚里]+)?(\d{1,4}个?[点小时钟:]+)?(\d{0,4}半?[分:秒]?钟?)?(\d{0,10}半?秒?钟?)?(后)?`)
|
|
|
|
|
if reg.MatchString(str) {
|
|
|
|
|
pts := reg.FindStringSubmatch(str)
|
|
|
|
|
setAsDate := false
|
|
|
|
@ -136,6 +136,9 @@ func matchPeriodPattern01(base time.Time, str string) (startimer.StarTimer, erro
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if pts[8] != "" {
|
|
|
|
|
if pts[8] == "半" {
|
|
|
|
|
pts[8] = "30"
|
|
|
|
|
}
|
|
|
|
|
if rpt.Every == setAsDate {
|
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_SECOND, Value: uint32(getNumbers(pts[8]))})
|
|
|
|
|
} else if rpt.Every && !setAsDate {
|
|
|
|
|