Download Cheat sheet PDF 12 pages · syntax, editors, patterns, Unicode, performance, debugging
Pattern

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)$
Open in explainer → Download cheat sheet ↓

Token-by-token breakdown

Every part of the pattern, left to right:

TokenMeaning
^start of string (or line in multiline mode)
(start of a capturing group
Mondayliteral text “Monday”
|OR — try the alternative
Tuesdayliteral text “Tuesday”
|OR — try the alternative
Wednesdayliteral text “Wednesday”
|OR — try the alternative
Thursdayliteral text “Thursday”
|OR — try the alternative
Fridayliteral text “Friday”
|OR — try the alternative
Saturdayliteral text “Saturday”
|OR — try the alternative
Sundayliteral text “Sunday”
|OR — try the alternative
Monliteral text “Mon”
|OR — try the alternative
Tueliteral text “Tue”
|OR — try the alternative
Wedliteral text “Wed”
|OR — try the alternative
Thuliteral text “Thu”
|OR — try the alternative
Friliteral text “Fri”
|OR — try the alternative
Satliteral text “Sat”
|OR — try the alternative
Sunliteral 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:

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.


← Back to all patterns