Page 1 of 1

matches_regex check

Posted: Fri Oct 05, 2012 12:16 am
by U
I am trying to get a regular expression to work in a Data Rule. The object is to create a matches_regex check for a date in DMY format with / delimiter.

Code: Select all

placeholder matches_regex "^(0?[1-9]|[12]\d|3[01])/(0?[1-9]|1[012])/((19|20)?\d\d)$"
This works in various online regex testers but not in Information Analyzer data rules. For example the dates 17/11/11 and 17/10/2011 are reported (in View Test Results for the Data Rule Definition) as not meeting the rule, while 19/09/2011 is reported as a match.

Can anyone shed any light on what might be happening?

Thank you for your time.

Posted: Tue Oct 09, 2012 6:43 am
by rjdickson
I know this does not answer your question directly, but according to the documentation, 'is_date' will check for dd/mm/yy and dd/mm/yyyy.

http://publib.boulder.ibm.com/infocente ... 4%65%22%20

Posted: Tue Oct 09, 2012 2:38 pm
by ray.wurlod
However is_date does not check for d/m/yyyy, dd/m/yyyy or d/mm/yyyy, or variants with two digit year, all if which U's regex seems to want to check. If I get time I'll verify the results this week.