Quote:
Originally Posted by WolfShade
/^\d{1,2}[\/-]\d{2,4}$/ should do it. One or two numbers, followed by either / or -, followed by either 2 or 4 numbers.
|
But that expression also allows the year to be a 3-digit number since using the syntax n{x,y} allows a number of digits anywhere between and including x and y. I need it to just accept two or four digits, and not anything else.