I'm building some software that needs a scheduling input, and I'd really like to re-use the design of crontab because it simply works.
CrontabExpressions can be really simple */5 * * * *
"run every five minutes" or more complex 2-59/3 1,9,22 11-26 1-6 ? 2003
"In 2003 on the 11th to 26th of each month in January to June every third minute starting from 2 past 1am, 9am and 10pm".
I am not looking to use the linux software called crontab, I'm seeking a way I can evaluate these expressions correctly (for instance, output the next 25 timestamps that match the crontab, or generate it based on some abstracted GUI for the users).
I can't really find any libraries or functions that do this in JavaScript or PHP or even other languages. If they don't exist, what would be a good method to do this? I already know an overly-complicated regular expression is likely to be the wrong answer. I'm having a hard time finding the C source code in crontab that does this task as well, which makes me believe it might not take place here?