I want to extract the cron expression from a crontab line. I tried 2 regular expressions (pcre php):
^(.*?)(?=[a-zA-Z])
.. which works for */1 * * * * wget --spider ...
and
^(.*?)(?=\/[a-zA-Z])
.. which works for */1 * * * * /my/path/ ...
I also tried to combine both:
^(.*?)(?=\/[a-zA-Z])|(?=[a-zA-Z])
... but this catches the "wget" in sample 1, too. I dont want to match the exact expression */1 * * * *
, this is just a sample. It must work for any cron expression.