Validating Crontab Entries with PHP

后端 未结 7 1135
青春惊慌失措
青春惊慌失措 2020-11-29 05:43

What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I\'ve got a PHP script that adds/removes entries from a crontab

相关标签:
7条回答
  • 2020-11-29 06:23

    You should be able to do that fairly easily with regex. In fact, I wouldn't be surprised if you could find an existing regex for just that on Google. This is untested, but perhaps something like:

    /^((\*)|(\d+((-\d+)|(,\d+)+))\s+){5}/
    
    0 讨论(0)
提交回复
热议问题