Your problem is HOW you are attempting to set the "ignore case" option.
For example, consider:
(0?[1-9]|[12][0-9]|3[01]|(?i:un))
This is interpreted as 4 alternatives that are (in order):
- match an optional 0 followed by a single digit from "1" to "9"
- match a "1" or "2" followed by a digit from "0" to "9" (by the way, this last bit can be shorted to '\d')
- match a "3" followed by a "0" or "1"
- turn on the "ignore case" option and match the "UN"(or "un" or "Un" or "uN") characters
In the last alternative, the effect of turning on the "ignore case" option lasts ONLY to the end of the group. Therefore it has no impact on the part of your pattern that matches the month names.
Within the section that matches the month names, there is the last alternative which is:
DEC(?i:unk)
What this does is to try to match the "DEC" characters (uppercase only) which MUST be followed by a case insensitive "unk". I suspect that you are missing an alternation operator between the "C" and the "(" in the part of the pattern. However, the same comment applies in that the setting of the "ignore case" option only lasts as far as the end of the group.
You could either make the whole pattern case insensitive (as per the previous response to your posting) or use something like:
^(0?[1-9]|[12][0-9]|3[01]|(?i:un))-(?i)(JAN|FEB|FEb|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|unk)-(19|20)\\d\\d$
By the way, if this is the case you can probably remove the duplication of the "FEB" (and "FEb") alternatives. Note that I have also made the last month name alternative simply '|unk)'
Susan