I’m working on a regular expression that will only return true when a date string is in a format something like ‘ddd, dd mmm yy’.
Valid matches would be values like “Sun, 20 Jun 10” or “Mon, 21 Jun 10” but not “Sunday, 20 Jun 10” or “20 Jun 10”.
This will be used with mb_ereg in PHP.
My attempts so far have only got me half way there. Any help appreciated!
Thanks,
Dave
This is one solution. Days like “00” are not allowed.
If you want to allow days without leading zeros you will have to use this regex (just added an questionmark. This means dates like “Sun, 8 Jun 10” are also valid with the following regex.