Data & Formatting · In-Browser Regular Expression Lab
Cron Expression Regex — Validate Standard 5-Field Schedules
Matches standard Unix crontab schedules (minute, hour, day of month, month, day of week).
Flags:
//none
Match Found
Load Sample:
Match Inspection & Details1 match
Match #1:0 0 * * *
Test Samples Verification Matrix
Expected Valid Samples (Should Match)
0 0 * * * Pass
*/15 * * * * Pass
30 4 1,15 * 5 Pass
Expected Invalid Samples (Must Reject)
0 0 * * Rejected (Pass)
* * * * * * Rejected (Pass)
every day Rejected (Pass)
Code Implementation Generator
// JavaScript / TypeScript (ES6+)
const pattern = /^(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+|[a-zA-Z]{3})\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+|[a-zA-Z]{3})$/;
const text = "0 0 * * *";
const isMatch = pattern.test(text);
console.log("Is Match:", isMatch);
if (isMatch) {
const matches = text.match(pattern);
console.log("Matches:", matches);
}Regular Expression Token Breakdown
Validates 5 whitespace-separated fields supporting asterisks, ranges, step values, and names. Each component of the regular expression serves a distinct syntactical purpose as mapped below:
| Token Pattern | Name / Component | Function & Rule |
|---|---|---|
| Field 1 | Minutes | 0-59, *, */5, etc. |
| Field 2 | Hours | 0-23, *, 12-18, etc. |
| Field 3 | Day of Month | 1-31, *. |
| Field 4 | Month | 1-12, JAN-DEC, *. |
| Field 5 | Day of Week | 0-6 (Sun-Sat), MON-FRI, *. |
Frequently Asked Questions
Does this match 6-field Quartz cron expressions?
Related Regular Expressions
Browse All 40 PatternsData & Formatting
ISO 8601 Combined Timestamp
Matches ISO 8601 timestamps like 2026-10-14T22:30:00.000Z or with +/- timezone offsets.
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/Test regex
Data & Formatting
24-Hour Time Format (HH:mm:ss)
Matches 24-hour military and standard timestamps in HH:mm or HH:mm:ss format.
/^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/Test regex
Data & Formatting
ISO Date (YYYY-MM-DD)
Validates 4-digit year, 2-digit month (01-12), and 2-digit day (01-31) in ISO format.
/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/Test regex