Tuesday, December 13, 2005

Got to love PRGs



preg_match("/^(20[0-4][0-9]|19[6-9][0-9])\-(1[0-2]|0[1-9]|[1-9])\-([1-3]0|[0-3][1-9]|[1-9])$/", $string)

This is matches a YYYY-MM-DD date with a little checking.

--
Matt
paranoidgeek@gmail.com
"No shirt, No shoes, No BRAIN: No service"

0 comments: