I have a cron expression with symbols words and digits:
0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2010
And I have a regexp for parsing of this cron expression for Java:
^([\d,\-\*\/]*\s+){3}([(LW)\d,\-\*\?\/]+\s+)([(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\d\,\-\*\?\/\#]+\s+)([(SUN|MON|TUE|WED|THU|FRI|SAT)\(LW)\d,\-\*\?\/\#]+\s*)([\d,\-\*\/\#]+){0,1}$
It works almost fine, but there is a problem. If I add an additional letter for any of words (for example: 'JAAAN') it also parses this cron expression. I need help. How can I solve it to parse only specific word in all my combination (as listed), such as 'JAN' or 'FEB' but not 'JANU' or 'FEBR'.
Please, I need help!
You did not provide enough data, so it won't be pretty:
See regex proof.
EXPLANATION