Help on Regular Expression for Cronjob testing

Posted on 2005-04-24
Last Modified: 2006-11-18
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
Question by:AndyWHV
    LVL 84

    Accepted Solution

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

    Author Comment

    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 ? 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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now