• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

Help on Regular Expression for Cronjob testing

I need a small test for Cronjob entries...

things like */5 can be ignored

this works...


i would appreciate any comments
(i am neither an expert in perl nor in regex ....i think in the perl topic i can find the most regex gurus)

so please let me know if this is good

greetz andy
1 Solution
/^\s*\w+\s*=\s*.*/ || /\s*#.*/ || /^\s*\@(reboot|yearly|annually|monthly|weekly|daily|midnight|hourly)\s+.*/  ||
AndyWHVAuthor Commented:
i need the time only (no command...) so the expression may end when all the time is specified...
i modified yours a bit because i experienced errors on months and weekdays with my tests
(\/\d\d?) here should follow always a ? ....like you did in minutes,hours and days, right ?

 /^\s*\w+\s*=\s*.*/ || /\s*#.*/ || /^\s*\@(reboot|yearly|annually|monthly|weekly|daily|midnight|hourly)\s+.*/  ||

thank you for this amazing help :-)

now it seems pretty good

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now