Forum Moderators: coopster
after checking many books and internet resources I give up.
I found this regular expression to check a date on www.regexlib.com and I can't get it to work in PHP:
<mod note>
the following 4 lines should be all on one, sorry tough edit and a ton of side scroll : jatar_k
</mod note>
^(?:(?:31(\/¦-¦\.)(?:0?[13578]¦1[02]))\1¦(?:(?:29¦30)(\/¦-¦\.)
(?:0?[1,3-9]¦1[0-2])\2))(?:(?:1[6-9]¦[2-9]\d)?\d{2})$¦^(?:29(\/¦-¦\.)0?2\3
(?:(?:(?:1[6-9]¦[2-9]\d)?(?:0[48]¦[2468][048]¦[13579][26])¦(?:(?:16¦[2468][048]¦[3579][26])00))))
$¦^(?:0?[1-9]¦1\d¦2[0-8])(\/¦-¦\.)(?:(?:0?[1-9])¦(?:1[0-2]))\4(?:(?:1[6-9]¦[2-9]\d)?\d{2})$
(This expression should basically match any German style date like 29.04.1600, also providing a check on leap years)
I assume it is a synthax problem but I am not sure. Also, I have no clue what the sythax "?:" is supposed to mean.
Can anybody help?
Thanks a bunch,
Lars
[edited by: jatar_k at 5:17 am (utc) on April 30, 2003]