1

I am using Data Reviewer to check to see if a string field is in the time format HHMM using the regular expression check. I think I have the correct logic with this:

^([0[0-9]|1[0-9]|2[0-4])[0-5][0-9]

but data reviewer doesn't pass any valid times with this expression (1234, 1259, 1340, 0013, 0240, 2349 all show up as errors, for example).

Is the Data Reviewer regular expression in SQL format, or is there something I am missing when writing regular expressions for data reviewer? I got the date check in YYYYMMDD format working no problem with:

((17)|(18)|(19)|(20))\d\d((0[1-9])|(1[012]))((0[1-9])|([12][0-9])|(3[01]))

1 Answer 1

1

A bit late, but you have an extra [ at the beginning of your regex.

It should be ^(0[0-9]|1[0-9]|2[0-4])[0-5][0-9].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.