DeanWhitehouse Posted July 8, 2009 Share Posted July 8, 2009 I am trying to ensure that a date is entered in this format (mm/yyyy) I am not good at regex, i tried this echo preg_match("/[^0-9]{2}+\/+[^0-9]{4}/", $string); But i don't think it works Any ideas? Thanks, Blade Link to comment https://forums.phpfreaks.com/topic/165211-solved-data-validation/ Share on other sites More sharing options...
ignace Posted July 8, 2009 Share Posted July 8, 2009 If you want to test your regex in real-time then use: http://www.gskinner.com/RegExr/ echo preg_match('/[0-9]{2}\/[0-9]{4}/', $string); Link to comment https://forums.phpfreaks.com/topic/165211-solved-data-validation/#findComment-871191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.