RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})
Description
Checks for Date in the typical MySQL DB Format. Not mutch but simple to for converting to German date format: $date = "2003-12-03"; if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) { echo "$regs[3].$regs[2].$regs[1]"; // prints 03.12.2003 }
Matches
2002-11-03 | 2007-17-08 | 9999-99-99
Non-Matches
2002/17/18 | 2002.18.45 | 18.45.2002
Author Rating: Not yet rated. Mike T Spike
Source http://www.php.net (Comments on ereg function)
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials