Regex for Day of week name
English day name, full or abbreviated.
The Day of week name regex is ^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$ — copy it below, or open it in the explainer for a token-by-token breakdown.
The pattern
^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$
Token-by-token breakdown
Every part of the pattern, left to right:
| Token | Meaning |
|---|---|
^ | start of string (or line in multiline mode) |
( | start of a capturing group |
Monday | literal text “Monday” |
| | OR — try the alternative |
Tuesday | literal text “Tuesday” |
| | OR — try the alternative |
Wednesday | literal text “Wednesday” |
| | OR — try the alternative |
Thursday | literal text “Thursday” |
| | OR — try the alternative |
Friday | literal text “Friday” |
| | OR — try the alternative |
Saturday | literal text “Saturday” |
| | OR — try the alternative |
Sunday | literal text “Sunday” |
| | OR — try the alternative |
Mon | literal text “Mon” |
| | OR — try the alternative |
Tue | literal text “Tue” |
| | OR — try the alternative |
Wed | literal text “Wed” |
| | OR — try the alternative |
Thu | literal text “Thu” |
| | OR — try the alternative |
Fri | literal text “Fri” |
| | OR — try the alternative |
Sat | literal text “Sat” |
| | OR — try the alternative |
Sun | literal text “Sun” |
) | end of group |
$ | end of string (or line in multiline mode) |
About this pattern
Date and time formats vary enormously across regions and systems. The regex here validates structure only — a date like 2024-02-30 would pass format validation but isn't a real date. After regex passes, parse with your language's date library to confirm semantic validity.
Quick usage in different languages
This exact pattern — with the correct escaping and idioms for each language:
- JavaScript:
/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/.test(value) - Python:
re.match(r"^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$", value) - Java:
Pattern.compile("^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$").matcher(value).matches() - C# / .NET:
Regex.IsMatch(value, @"^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$") - Go:
regexp.MustCompile(`^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$`).MatchString(value) - Ruby:
/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/.match?(value) - PHP:
preg_match('~^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun)$~', $value)
The explainer’s Code tab regenerates these for any pattern you paste, and the downloadable cheat sheet bundles the breakdown, all seven snippets, and the pitfalls below onto one printable page.
Common pitfalls
- Anchored to the whole string. This pattern uses ^ and $, so it requires the entire input to match. To find it inside a longer text, drop the anchors and use the global (g) flag.
- Validate beyond format. Matching the format doesn't guarantee the value is real. Confirm the day of week name against a source of truth (database, API, or checksum) where it matters.
Related patterns
More patterns in the Date & time category:
- Month name
- Year + quarter
- ISO 8601 week date
- Cron expression (5-field)
- ISO 8601 date (YYYY-MM-DD)
- RFC 2822 date
See also
Browse all 300 patterns in the library, or open this regex in the interactive explainer to see a token-by-token breakdown, test against custom input, and generate code in seven languages.