Skip to content

Commit deb52ae

Browse files
fix: cron regex (#1079)
* fix: cron regex * fix: testing love * fix: testing love * fix: test love
1 parent 06ece5e commit deb52ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/regex/src/__tests__/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const subDomain = 'sub.another-example.com'
4848
const dashStartDomain = '-sub.another-example.com'
4949
const uppercaseDomain = 'SUB.another-example.com'
5050
const longTldDomain = 'sub.another-example.verylongtld'
51-
const cronTest = '0/15*-'
51+
const cronTest = '0 0 0 * * 0 1-4'
5252
const digitsTest = '0123456789'
5353
const emailTest = '[email protected]'
5454
const fourDigitsTest = '2345'

packages/regex/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/
2222
export const uppercaseBasicDomain =
2323
/^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/
2424

25-
export const cron = /^[0-9,/*-]+$/
25+
export const cron = /^((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$/
2626
export const digits = /^[0-9]*$/
2727
export const macAddress =
2828
/^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/

0 commit comments

Comments
 (0)