A regular expression that matches month names. Supports both full month names and 3-letter abbreviations. So you can easily check if the user inputs a valid month name or not.
/\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)/g
Matches:
- Feb
- February
- December
- February March
Non-matches:
- Fe
- Febr
See Also:
- Regular Expression For Year
- Month Regular Expression
- Regex To Match ISO 8601 Dates and Times
- Date (YYYY-MM-DD) Regular Expression
- Regular Expression To Match Names Of The Days Of The Week
- Regex To Match A Valid Day In A Date String