Date yyyy/mm/dd

Published on Tue Mar 01 2022

Regex following "ISO 8601" without hour : allowing only month 1 to 12, the day of 1 to 31 for the months of 31 days, the months from 1 to 30 for the months of 30 days, the day of 1 to 28 for February, and the day from 1 to 29 for February of leap years

Additional matching regexes for
Date yyyy/mm/dd

Date yyyy/mm/dd

Regex following "ISO 8601" without hour : allowing only month 1 to 12, the day of 1 to 31 for the months of 31 days, the months from 1 to 30 for the months of 30 days, the day of 1 to 28 for February, and the day from 1 to 29 for February of leap years

Timestamp

12.04.1975T03:02:00.88 With milliseconds and T seperator. Excludes most invalid dates, except 30/31ths of month, leap years/february heaving only 29/28.

Month Day, Year match

Match a date in the following Month Day, Year format: June 14, 2013

Mobile Number Regex

The following regex validates international mobile numbers

Date - Extract & Validate - Fully tested - Format YYYY-MM-DD (dynamic parts separator / can use a different separator)

A fully tested regex that extracts and validates date parts using named capturing groups. \ **Validations:** - Year must be preceded by nothing or a non-digit character - Year must have 4 digits - Month must be between 01 and 12 - Month must have 2 digits - Day must be between 01 and the maximum number of days for the month (e.g. february can't have more than 29 days) - Day must have 2 digits - Day must be followed by nothing or a non-digit character - Separator must be any single character that is not a space or an alphanumeric character - Separator must be the same between each date part \ **Capturing groups:** ```plain | # | Name | Description | |:-:|:-------:|-------------------------------------| | 1 | `year` | 4 digits of the year | | 2 | `sep` | Date parts separator | | 3 | `month` | 2 digits of the month | | 4 | `day` | 2 digits of the date (day of month) | ``` \ **Example usage:** ```js let match = regex.exec('2020-11-22') console.log('year: %s, month: %s, day: %s', match.groups.year, match.groups.month, match.groups.day) // year: 2020, month: 11, day: 22 ``` \ **Compatibility:** _(updated 2020-11-20)_ - Chrome >= 64 - Edge >= 79 - Firefox >= 78 - IE incompatible (lookbehind assertions & named capture groups not supported) - Opera >= 51 - Safari incompatible (lookbehind assertions not supported) - NodeJS >= 10.0.0 See [regex compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Browser_compatibility). \ _**Note:** does not validate leap years (not really possible in regex)_

AutoDateRegex

Regex for date for example in saved reports (01m-1y) beginning of last month Format -> dmy

RewriteMatch into subfolder

RegEx for an .htaccess rewrite into a subfolder without provoking a 'too many redirects' error

Date: DD-MM-YYYY hh:mm:ss

Validate and capture dateTime parts, includes validation for leap years, range 1000-2999. Fixed bug

Date regex

this regex check if the date is in the format d/m/Y H:i , it will not check the number of days in month

Select all chars before last backslash

For selecting paths without filename