I want to check if the input matches this format:
format: "dd/MM/yyyy"
Of course they would have to me numbers. What is the regex expression, and/or jquery/javascript function that i'd use to make sure this input matches this?
I want to check if the input matches this format:
format: "dd/MM/yyyy"
Of course they would have to me numbers. What is the regex expression, and/or jquery/javascript function that i'd use to make sure this input matches this?
This should do it:
/^[0123]?\d\/[01]?\d\/\d{2,}$/
Remember that only certain numbers are valid months and days.
Other approaches can be found at the Regular Expression Library.