Yes, the string must contain pattern 'dd', 'mm' and 'yyyy' in any order, for instance, 'dd/mm/yyyy'or 'mm/dd/yyyy or 'yyyy-mm-dd', which means value 'ddddddddddmmmmmmmmmmmmmyyyyyyyyyyyyyyy' should throw false.
I think my statement will give 'True' by using value 'ddddddddddmmmmmmmmmmmmmyyyyyyyyyyyyyyy', which is not correct. It would be great, if your or anyone, could help to corect my logic.
Actually I have another problem which I don't know how to solve it
by using pattern. It will be easier for us to understand by using a pseudocode expression:
Code:
var format = 'dd/mm/yyyy';
// pseudocode
if (format contains 2 '/' charaters)
return true;
else // case if contains more/less than 2 or contains no '/' character
return false;
Thanks in advance.