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 Quote 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); Quote Link to comment https://forums.phpfreaks.com/topic/165211-solved-data-validation/#findComment-871191 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.