Skip to content

Instantly share code, notes, and snippets.

@paulchubatyy
Created September 2, 2010 08:56
Show Gist options
  • Save paulchubatyy/562072 to your computer and use it in GitHub Desktop.
Save paulchubatyy/562072 to your computer and use it in GitHub Desktop.
<?php
$re = array(
'/',
'.*?', # Non-greedy match on filler
'((?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Tues|Thur|Thurs|Sun|Mon|Tue|Wed|Thu|Fri|Sat))', # Day Of Week 1
'.*?', # Non-greedy match on filler
'((?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?))', # Month 1
'.*?', # Non-greedy match on filler
'((?:(?:[0-2]?\\d{1})|(?:[3][0,1]{1})))(?![\\d])', # Day 1
'.*?', # Non-greedy match on filler
'((?:(?:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3})))(?![\\d])', # Year 1
'/is',
);
$checkPattern = implode('', $re);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment