MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / isSixFieldCronExpression

Function isSixFieldCronExpression

lib/crontab.go:819–824  ·  view source on GitHub ↗
(splitLine []string)

Source from the content-addressed store, hash-verified

817}
818
819func isSixFieldCronExpression(splitLine []string) bool {
820 matchDigitOrWildcard, _ := regexp.MatchString("^[-,?*/0-9]+$", splitLine[5])
821 matchDayOfWeekStringRange, _ := regexp.MatchString("^(Mon|Tue|Wed|Thr|Fri|Sat|Sun)(-(Mon|Tue|Wed|Thr|Fri|Sat|Sun))?$", splitLine[5])
822 matchDayOfWeekStringList, _ := regexp.MatchString("^((Mon|Tue|Wed|Thr|Fri|Sat|Sun),?)+$", splitLine[5])
823 return matchDigitOrWildcard || matchDayOfWeekStringRange || matchDayOfWeekStringList
824}
825
826func CurrentUserCrontab() string {
827 if u, err := user.Current(); err == nil {

Callers 1

ParseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected