Regular Expressions 101

Community Patterns

1...45678...11

Community Library Entry

0

Regular Expression
Java 8

"
((((([1-5]?[0-9])([-]([1-5]?[0-9]))?)|[*])([/]([1-5]?[0-9]))?)([,](((([1-5]?[0-9])([-]([1-5]?[0-9]))?)|[*])([/]([1-5]?[0-9]))?))*) ((((([2][0-3]|[1]?[0-9])([-]([2][0-3]|[1]?[0-9]))?)|[*])([/]([2][0-3]|[1]?[0-9]))?)([,](((([2][0-3]|[1]?[0-9])([-]([2][0-3]|[1]?[0-9]))?)|[*])([/]([2][0-3]|[1]?[0-9]))?))*) ((((([3][0-1]|[1-2]?[0-9])([-]([3][0-1]|[1-2]?[0-9]))?)|[*])([/]([3][0-1]|[1-2]?[0-9]))?)([,](((([3][0-1]|[1-2]?[0-9])([-]([3][0-1]|[1-2]?[0-9]))?)|[*])([/]([3][0-1]|[1-2]?[0-9]))?))*) ((((([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)([-]([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?)|[*])([/]([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?)([,](((([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)([-]([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?)|[*])([/]([1][0-2]|[0-9]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))*) ((((([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT)([-]([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT))?)|[*])([/]([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT))?)([,](((([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT)([-]([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT))?)|[*])([/]([0-7]|SUN|MON|TUE|WED|THU|FRI|SAT))?))*)
"
gm

Description

This checks the syntax for CRON

Submitted by Till Hummel - 2 years ago