RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 4
Title Test Details day/month/year validate date
Expression
(?:\s|^)(?P<day>(?P<threeone>31)|(?P<thirty>30)|(?P<twonine>29)|(?P<twoeight>2[0-8]|1[0-9]|0?[1-9]))(?P<sep>[/\-\.:])(?P<month>(?(threeone)(?:1[02]|0?[13578]))(?(thirty)(?:1[012]|0?[13456789]))(?(twonine)(?:1[012]|0?[13-9]|(?P<leap>0?2)))(?(twoeight)(?:1[012]|0?[1-9])))(?P=sep)(?P<year>(?:\d\d)?(?(leap)(?:(?:[02468][048])|(?:[13579][26]))|(?:\d\d)))(?:$|\s)
Description
This matches valid dates (including leap year dates of the following formats : dd/mm/yy dd/mm/yyyy d/m/yy d/m/yyyy dd-mm-yy dd-mm-yyyy d-m-yy d-m-yyyy dd.mm.yy dd.mm.yyyy d.m.yy d.m.yyyy use the named groups day, month, year
Matches
29/02/2096
Non-Matches
29/02/2097, 31/04/2020
Author Rating: The rating for this expression. James Maguire
Title Test Details dd-MMM-yyy date validator
Expression
(?:\s|^)(?P<day>(?P<threeone>31)|(?P<thirty>30)|(?P<twonine>29)|(?P<twoeight>2[0-8]|1[0-9]|0?[1-9]))(?P<sep>[/\-\.:])(?P<month>(?(threeone)(?:jan|mar|may|jul|aug|oct|dec))(?(thirty)(?:jan|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))(?(twonine)(?:jan|(?P<feb>feb)|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|))(?(twoeight)(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))(?P=sep)(?P<year>(?:\d\d)?(?(twonine)(?(feb)(?:(?:[02468][048])|(?:[13579][26]))|(?:\d\d))))(?:$|\s)
Description
Validates dates in the (d)d-MMM-(yy)yy format
Matches
29-feb-2020, 1-jan-01
Non-Matches
29-feb-19, 31-sep-2010
Author Rating: Not yet rated. James Maguire
Title Test Details dd-MMM-yyyy date validator
Expression
(?:\s|^)(?P<day>(?P<threeone>31)|(?P<thirty>30)|(?P<twonine>29)|(?P<twoeight>2[0-8]|1[0-9]|0?[1-9]))(?P<sep>[/\-\.:])(?P<month>(?(threeone)(?:jan|mar|may|jul|aug|oct|dec))(?(thirty)(?:jan|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))(?(twonine)(?:jan|(?P<feb>feb)|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|))(?(twoeight)(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))(?P=sep)(?P<year>(?:\d\d)?(?(twonine)(?(feb)(?:(?:[02468][048])|(?:[13579][26]))|(?:\d\d))|(?:\d\d)))(?:$|\s)
Description
Validates dates in the (d)d-MMM-(yy)yy format
Matches
29-feb-2020, 1-jan-01
Non-Matches
29-feb-19, 31-sep-2010
Author Rating: The rating for this expression. James Maguire
Title Test Details British ordinal date
Expression
(?:\s|^)(?P<day>(?P<threeone>31(?:st)?)|(?P<thirty>30(?:th)?)|(?P<twonine>29(?:th)?)|(?P<twoeight>2(?:1(?:st)?|2(?:nd)?|3(?:rd)?)|2[04-8](?:th)?|1[0-9](?:th)?|0?1(?:st)?|0?2(?:nd)?|0?3(?:rd)?|0?[4-9](?:th))?)(?:(?P<sep>[/\-\.:])|\s|\sof\s)(?P<month>(?(threeone)(?:jan|mar|may|jul|aug|oct|dec|january|march|july|august|october|december))(?(thirty)(?:jan|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|janurary|march|april|june|july|august|september|october|november|december))(?(twonine)(?:jan|(?P<feb>feb|february)|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|march|april|june|july|august|september|october|november|december))(?(twoeight)(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|june|july|august|september|october|november|december)))(?(sep)(?P=sep)|,?\s)(?P<year>(?:\d\d)?(?(twonine)(?(feb)(?:(?:[02468][048])|(?:[13579][26]))|(?:\d\d))|(?:\d\d)))(?:$|\s)
Description
Does full ordinal british dates
Matches
2nd february 2020, 30th of january, 2020
Non-Matches
30th february 2020
Author Rating: The rating for this expression. James Maguire
   Displaying page 1 of 1 pages; Items 1 to 4

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials