RegexBench

← Library

Cron expression

Five-field cron lines (minute … weekday).

Pattern

/(?:\*|(?:\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)|\*\/\d+)(?:\s+(?:\*|(?:\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)|\*\/\d+)){4}/

Sample text

0 9 * * 1-5
*/15 * * * *
not cron
Test this pattern in the editor

Related patterns