I want to check an input in a form to validate this format.
I use this RegEx but it doesn't work like i want ( to be in this format HH:MM:SS:mm )
HH : hours
MM : minutes
SS : seconds
mm : milliseconds
/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\\.([0-9]{1,3}))?$/i
I have used the jquery validation plugin for testing the form, this is the example of method that i create including this RegEx :
$.validator.addMethod("timeFormat", function(value, element) {
return this.optional(element) || /^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\\.([0-9]{1,3}))?$/i.test(value);
}, "");
what's wrong with this ?