I'm using a date picker, but a date can be entered directly so I have to validate it. I tried a couple of different regular expressions as custom patterns, but InfoPath thinks data is invalid even when it is valid.
Also, the field is not required so leaving it blank should also be considered valid. This is a second issue I need to address, ie. making the whole pattern optional.
Back to the first issue, this is what I tried:
(0[1-9]|1[012])/(0[1-9]|[12][0-9]|3[01])/(19|20)\d\d
InfoPath considered this valid and displayed an Example based on this pattern of "01/01/1900". I used the "does not match pattern" option so that anything that doesn't match this pattern will be considered invalid. The result is that everything is considered invalid, even proper dates in the above format.
I also tried:
\d\d?/\d\d?/\d\d\d\d
InfoPath considered this valid and displayed an Example based on this pattern of "00/00/0000". Valid dates are still considered invalid (along with everything else).
Please help! Thanks in advance!